From 30230c52f69d1b5f48d3ec9ae5f2a6d669271c08 Mon Sep 17 00:00:00 2001 From: Gareth Barnard <1058419+gjb2048@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:57:11 +0000 Subject: [PATCH] V405.1.0 --- Changes.md | 9 + SupportAndSponsorship.md | 4 +- amd/build/adaptable.min.js | 4 +- amd/build/adaptable.min.js.map | 2 +- amd/build/collapseblock.min.js | 4 +- amd/build/collapseblock.min.js.map | 2 +- amd/build/icon_system_fontawesome.min.js | 4 +- amd/build/icon_system_fontawesome.min.js.map | 2 +- amd/build/pace.min.js | 2 +- amd/build/pace.min.js.map | 2 +- amd/build/pace_init.min.js | 5 + amd/build/pace_init.min.js.map | 1 + amd/src/adaptable.js | 4 - amd/src/pace.js | 2 +- amd/src/pace_init.js | 36 + classes/output/core_renderer_layout.php | 7 + classes/output/external.php | 6 +- lang/en/theme_adaptable.php | 45 +- lib.php | 33 +- scss/main.scss | 1 + scss/nosettings/_pace.scss | 1812 +++++++++++++++++ scss/settings/adaptable.scss | 22 - settings.php | 9 +- settings/block_settings.php | 6 +- settings/colors.php | 9 - settings/custom_menus.php | 42 +- ...egions.php => frontpage_block_regions.php} | 2 +- settings/general.php | 74 + settings/news_ticker.php | 2 +- ...behat_theme_adaptable_behat_navigation.php | 4 +- ...ehat_theme_adaptable_behat_permissions.php | 3 +- version.php | 6 +- 32 files changed, 2055 insertions(+), 111 deletions(-) create mode 100644 amd/build/pace_init.min.js create mode 100644 amd/build/pace_init.min.js.map create mode 100644 amd/src/pace_init.js create mode 100644 scss/nosettings/_pace.scss rename settings/{block_regions.php => frontpage_block_regions.php} (97%) create mode 100644 settings/general.php diff --git a/Changes.md b/Changes.md index 047eb9f..40a603c 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,12 @@ +Change Log in version 405.1.0 (2024100501) +========================================== +1. Stable release for Moodle 4.5. +2. Fix 'newstickercount' incorrect default value. +3. Add Pace themes from https://codebyzach.github.io/pace/ and add 'pageloadingprogress' and 'pageloadingprogresstheme' settings to new 'General' tab. +4. Block regions to Frontpage block regions rename. +5. Prevent an open Adaptable settings window overwriting core settings in another. +6. Setting tabs fully alphabetical. + Change Log in version 405.0.1 (2024100500) ========================================== 1. Block region tidy when editing, 'Add block' button for each region and added 'blockregioneditingtitleshown' setting diff --git a/SupportAndSponsorship.md b/SupportAndSponsorship.md index 316f549..555f590 100644 --- a/SupportAndSponsorship.md +++ b/SupportAndSponsorship.md @@ -61,10 +61,10 @@ benefits. Required version of Moodle ========================== -This version works with Moodle 4.4 version 2024042200.00 (Build: 20240422) and above within the MOODLE_404_STABLE branch until the +This version works with Moodle 4.5 version 2024100700.00 (Build: 20241007) and above within the MOODLE_405_STABLE branch until the next release. -Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/404/en/Installing_Moodle)'. +Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/405/en/Installing_Moodle)'. Known issues ================ diff --git a/amd/build/adaptable.min.js b/amd/build/adaptable.min.js index c4924fb..ae00745 100644 --- a/amd/build/adaptable.min.js +++ b/amd/build/adaptable.min.js @@ -1,5 +1,5 @@ -define("theme_adaptable/adaptable",["exports","jquery","theme_adaptable/jqueryeasing","theme_adaptable/pace","theme_adaptable/util","core/log"],(function(_exports,_jquery,_jqueryeasing,_pace,AdaptableUtil,_log){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}} +define("theme_adaptable/adaptable",["exports","jquery","theme_adaptable/jqueryeasing","theme_adaptable/util","core/log"],(function(_exports,_jquery,_jqueryeasing,AdaptableUtil,_log){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}} // @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. -Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_jquery=_interopRequireDefault(_jquery),_jqueryeasing=_interopRequireDefault(_jqueryeasing),_pace=_interopRequireDefault(_pace),AdaptableUtil=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(AdaptableUtil),_log=_interopRequireDefault(_log);const adaptable=()=>{_log.default.debug("Adaptable ES6 adaptable"),(0,_jquery.default)(".breadcrumb li:not(:last-child) span").not(".separator").addClass(""),(0,_jquery.default)(".breadcrumb li:last-child").addClass("lastli");try{(0,_jquery.default)('.context-header-settings-menu .dropdown-menu .dropdown-item a[href*="edit"], #editingbutton a').click((function(event){event.preventDefault();var to=(0,_jquery.default)(window).scrollTop();sessionStorage.setItem("scrollTo",to);var url=(0,_jquery.default)(this).prop("href");return window.location.replace(url),!1}));var scrollTo=sessionStorage.getItem("scrollTo");null!==scrollTo&&(window.scrollTo(0,scrollTo),sessionStorage.removeItem("scrollTo"))}catch(e){_log.default.debug("Adaptable: Session storage exception: "+e.name)}let bttOn;let st=(0,_jquery.default)("#page").scrollTop();bttOn=!(st>150);var bttScrollCheck=function(){st=(0,_jquery.default)("#page").scrollTop(),st>150?0==bttOn&&(bttOn=!0,(0,_jquery.default)("#back-to-top").fadeIn(500)):1==bttOn&&(bttOn=!1,(0,_jquery.default)("#back-to-top").fadeOut(500))};if(bttScrollCheck(),(0,_jquery.default)("#page").scroll((function(){bttScrollCheck()})),(0,_jquery.default)("#back-to-top").click((function(event){return event.preventDefault(),(0,_jquery.default)("#page").animate({scrollTop:0},500),!1})),window.location.hash&&(0,_jquery.default)("body").hasClass("pagelayout-course")){var anchorTop=(0,_jquery.default)(window.location.hash).offset().top;(0,_jquery.default)("html, body").animate({scrollTop:anchorTop-102},500)}"fixed"==(0,_jquery.default)("header").css("position")&&(0,_jquery.default)(".outercont").css("padding-top",(0,_jquery.default)("header").height())},options=data=>{_log.default.debug("Adaptable ES6 options");var body=(0,_jquery.default)("body"),navbar=document.getElementById("main-navbar");if(data.stickynavbar){const screenmd=992,screensm=768;var currentWindowSize,windowWidth=(0,_jquery.default)(window).width();currentWindowSize=windowWidth0&&void 0!==arguments[0]&&arguments[0];if(pageScrollTop=page.scrollTop,windowWidth=aboveHeaderHeight)return;pageScrollTop=aboveHeaderHeight,newHeaderTop=0,newPageMarginTop=0}else{if(!update&¤tPageScrollTop==headerNoNavbar&&pageScrollTop>=headerNoNavbar)return;update&&(headerHeight=header.getBoundingClientRect().height,null!==navbar&&(navbarHeight=navbar.getBoundingClientRect().height),headerNoNavbar=headerHeight-navbarHeight),pageScrollTop>headerNoNavbar&&(pageScrollTop=headerNoNavbar),newHeaderTop=-pageScrollTop,newPageMarginTop=headerHeight-pageScrollTop}if(currentPageScrollTop=pageScrollTop,(update||newHeaderTop!=headerTop)&&(header.style.top=newHeaderTop+"px",headerTop=newHeaderTop),(update||newPageMarginTop!=pageMarginTop)&&(page.style.marginTop=newPageMarginTop+"px",pageMarginTop=newPageMarginTop),(courseIndex||sidePost)&&(newDrawerPaddingTop=windowWidth{if(_log.default.debug("Adaptable ES6 init"),(0,_jqueryeasing.default)(),_pace.default.start({document:!1}),data.stickynavbar){var shiftWindow=function(){scrollBy(0,-50)};location.hash&&shiftWindow(),window.addEventListener("hashchange",shiftWindow)}"loading"!==document.readyState?(_log.default.debug("Adaptable ES6 init DOM content already loaded"),adaptable(),options(data)):(_log.default.debug("Adaptable ES6 init JS DOM content not loaded"),document.addEventListener("DOMContentLoaded",(function(){_log.default.debug("Adaptable ES6 init JS DOM content loaded"),adaptable(),options(data)})))}})); +Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_jquery=_interopRequireDefault(_jquery),_jqueryeasing=_interopRequireDefault(_jqueryeasing),AdaptableUtil=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(AdaptableUtil),_log=_interopRequireDefault(_log);const adaptable=()=>{_log.default.debug("Adaptable ES6 adaptable"),(0,_jquery.default)(".breadcrumb li:not(:last-child) span").not(".separator").addClass(""),(0,_jquery.default)(".breadcrumb li:last-child").addClass("lastli");try{(0,_jquery.default)('.context-header-settings-menu .dropdown-menu .dropdown-item a[href*="edit"], #editingbutton a').click((function(event){event.preventDefault();var to=(0,_jquery.default)(window).scrollTop();sessionStorage.setItem("scrollTo",to);var url=(0,_jquery.default)(this).prop("href");return window.location.replace(url),!1}));var scrollTo=sessionStorage.getItem("scrollTo");null!==scrollTo&&(window.scrollTo(0,scrollTo),sessionStorage.removeItem("scrollTo"))}catch(e){_log.default.debug("Adaptable: Session storage exception: "+e.name)}let bttOn;let st=(0,_jquery.default)("#page").scrollTop();bttOn=!(st>150);var bttScrollCheck=function(){st=(0,_jquery.default)("#page").scrollTop(),st>150?0==bttOn&&(bttOn=!0,(0,_jquery.default)("#back-to-top").fadeIn(500)):1==bttOn&&(bttOn=!1,(0,_jquery.default)("#back-to-top").fadeOut(500))};if(bttScrollCheck(),(0,_jquery.default)("#page").scroll((function(){bttScrollCheck()})),(0,_jquery.default)("#back-to-top").click((function(event){return event.preventDefault(),(0,_jquery.default)("#page").animate({scrollTop:0},500),!1})),window.location.hash&&(0,_jquery.default)("body").hasClass("pagelayout-course")){var anchorTop=(0,_jquery.default)(window.location.hash).offset().top;(0,_jquery.default)("html, body").animate({scrollTop:anchorTop-102},500)}"fixed"==(0,_jquery.default)("header").css("position")&&(0,_jquery.default)(".outercont").css("padding-top",(0,_jquery.default)("header").height())},options=data=>{_log.default.debug("Adaptable ES6 options");var body=(0,_jquery.default)("body"),navbar=document.getElementById("main-navbar");if(data.stickynavbar){const screenmd=992,screensm=768;var currentWindowSize,windowWidth=(0,_jquery.default)(window).width();currentWindowSize=windowWidth0&&void 0!==arguments[0]&&arguments[0];if(pageScrollTop=page.scrollTop,windowWidth=aboveHeaderHeight)return;pageScrollTop=aboveHeaderHeight,newHeaderTop=0,newPageMarginTop=0}else{if(!update&¤tPageScrollTop==headerNoNavbar&&pageScrollTop>=headerNoNavbar)return;update&&(headerHeight=header.getBoundingClientRect().height,null!==navbar&&(navbarHeight=navbar.getBoundingClientRect().height),headerNoNavbar=headerHeight-navbarHeight),pageScrollTop>headerNoNavbar&&(pageScrollTop=headerNoNavbar),newHeaderTop=-pageScrollTop,newPageMarginTop=headerHeight-pageScrollTop}if(currentPageScrollTop=pageScrollTop,(update||newHeaderTop!=headerTop)&&(header.style.top=newHeaderTop+"px",headerTop=newHeaderTop),(update||newPageMarginTop!=pageMarginTop)&&(page.style.marginTop=newPageMarginTop+"px",pageMarginTop=newPageMarginTop),(courseIndex||sidePost)&&(newDrawerPaddingTop=windowWidth{if(_log.default.debug("Adaptable ES6 init"),(0,_jqueryeasing.default)(),data.stickynavbar){var shiftWindow=function(){scrollBy(0,-50)};location.hash&&shiftWindow(),window.addEventListener("hashchange",shiftWindow)}"loading"!==document.readyState?(_log.default.debug("Adaptable ES6 init DOM content already loaded"),adaptable(),options(data)):(_log.default.debug("Adaptable ES6 init JS DOM content not loaded"),document.addEventListener("DOMContentLoaded",(function(){_log.default.debug("Adaptable ES6 init JS DOM content loaded"),adaptable(),options(data)})))}})); //# sourceMappingURL=adaptable.min.js.map \ No newline at end of file diff --git a/amd/build/adaptable.min.js.map b/amd/build/adaptable.min.js.map index f05a91d..3a1e12a 100644 --- a/amd/build/adaptable.min.js.map +++ b/amd/build/adaptable.min.js.map @@ -1 +1 @@ -{"version":3,"file":"adaptable.min.js","sources":["../src/adaptable.js"],"sourcesContent":["//\n// This file is part of Adaptable theme for moodle\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n//\n\n// Adaptable main JS file\n//\n// @package theme_adaptable\n// @copyright 2015-2019 Jeremy Hopkins (Coventry University)\n// @copyright 2015-2019 Fernando Acedo (3-bits.com)\n// @copyright 2018-2019 Manoj Solanki (Coventry University)\n// @copyright 2019 G J Barnard\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport $ from 'jquery';\nimport jqueryeasingInit from 'theme_adaptable/jqueryeasing';\nimport pace from 'theme_adaptable/pace';\nimport * as AdaptableUtil from 'theme_adaptable/util';\nimport log from 'core/log';\n\nconst adaptable = () => {\n log.debug('Adaptable ES6 adaptable');\n\n // Breadcrumb.\n $(\".breadcrumb li:not(:last-child) span\").not('.separator').addClass('');\n $(\".breadcrumb li:last-child\").addClass(\"lastli\");\n\n // Edit button keep position. Needs session storage!\n try {\n $('.context-header-settings-menu .dropdown-menu .dropdown-item a[href*=\"edit\"], #editingbutton a')\n .click(function (event) {\n event.preventDefault();\n\n var to = $(window).scrollTop();\n sessionStorage.setItem('scrollTo', to);\n var url = $(this).prop('href');\n window.location.replace(url);\n\n return false;\n });\n var scrollTo = sessionStorage.getItem('scrollTo');\n if (scrollTo !== null) {\n window.scrollTo(0, scrollTo);\n sessionStorage.removeItem('scrollTo');\n }\n } catch (e) {\n log.debug('Adaptable: Session storage exception: ' + e.name);\n }\n\n // Scroll to top.\n const bttOffset = 150;\n const bttDuration = 500;\n let bttOn;\n const scrollDuration = 500;\n let st = $('#page').scrollTop();\n if (st > bttOffset) {\n bttOn = false;\n } else {\n bttOn = true;\n }\n var bttScrollCheck = function () {\n st = $('#page').scrollTop();\n if (st > bttOffset) {\n if (bttOn == false) {\n bttOn = true;\n $('#back-to-top').fadeIn(bttDuration);\n }\n } else {\n if (bttOn == true) {\n bttOn = false;\n $('#back-to-top').fadeOut(bttDuration);\n }\n }\n };\n bttScrollCheck();\n $('#page').scroll(function () {\n bttScrollCheck();\n });\n\n $('#back-to-top').click(function (event) {\n event.preventDefault();\n $('#page').animate({ scrollTop: 0 }, scrollDuration);\n return false;\n });\n\n // Anchor.\n if (window.location.hash) {\n if ($(\"body\").hasClass(\"pagelayout-course\")) {\n var anchorTop = $(window.location.hash).offset().top;\n $('html, body').animate({ scrollTop: anchorTop - 102 }, scrollDuration);\n }\n }\n\n // New for every three.\n if ($('header').css(\"position\") == \"fixed\") {\n $('.outercont').css('padding-top', $('header').height());\n }\n};\n\nconst options = (data) => {\n log.debug('Adaptable ES6 options');\n var body = $(\"body\");\n // Get the navbar, if present.\n var navbar = document.getElementById(\"main-navbar\");\n\n if (data.stickynavbar) {\n /* New way to handle sticky navbar requirement.\n Simply taken from https://www.w3schools.com/howto/howto_js_navbar_sticky.asp. */\n\n const screenmd = 992;\n const screensm = 768;\n var windowWidth = $(window).width();\n var currentWindowSize;\n if (windowWidth < screensm) {\n currentWindowSize = 1;\n } else if (windowWidth < screenmd) {\n currentWindowSize = 2;\n } else {\n currentWindowSize = 3;\n }\n\n // Container.\n var header = document.getElementById(\"adaptable-page-header-wrapper\");\n var aboveHeader = document.getElementById(\"header1\");\n if (!aboveHeader) {\n aboveHeader = document.getElementById(\"header2\");\n }\n\n // Drawers.\n var courseIndex = document.getElementById(\"theme_adaptable-drawers-courseindex\");\n var sidePost = document.getElementById(\"theme_adaptable-drawers-sidepost\");\n var drawerTogglers = document.getElementsByClassName(\"drawer-toggler\");\n\n // Page.\n var page = document.getElementById(\"page\");\n\n // Adjustments.\n var pageScrollTop = page.scrollTop;\n var currentPageScrollTop = pageScrollTop;\n var headerHeight = 0;\n var headerNoNavbar = 0;\n var navbarHeight = 0;\n if (navbar !== null) {\n navbarHeight = navbar.getBoundingClientRect().height;\n }\n var aboveHeaderHeight = aboveHeader.getBoundingClientRect().height;\n\n var drawerPaddingTop = 0;\n var newDrawerPaddingTop = 0;\n var pageMarginTop = 0;\n var newPageMarginTop = 0;\n var headerTop = 0;\n var newHeaderTop = 0;\n\n var isFixed = 0;\n /* Ok, here's an odd one... desktops need to use the 'inner' variables and mobiles the 'outer'\n to be accurate! But... I've (GB) found that the jQuery height and width functions adapt and\n report close to correct values regardless of device, so use them instead without complicated\n device detection here! Update: postion:fixed does not work on mobiles at the moment so won't\n be for such, left comment for future info. */\n\n /* Top navbar stickyness.\n As per above comments, some issues noted with using CSS position: fixed, but these seem to mostly be constrained\n to older browsers (inc. mobile browsers). May need to revisit!\n https://caniuse.com/#feat=css-fixed */\n if (windowWidth < screenmd) {\n header.classList.remove(\"sticky\");\n body.addClass(\"page-header-margin\");\n isFixed = 1;\n } else {\n header.classList.add(\"sticky\");\n body.removeClass(\"page-header-margin\");\n }\n\n var makeNavbarSticky = function (update = false) {\n pageScrollTop = page.scrollTop;\n\n if (windowWidth < screenmd) {\n if ((!update) && (currentPageScrollTop == aboveHeaderHeight) && (pageScrollTop >= aboveHeaderHeight)) {\n return;\n }\n pageScrollTop = aboveHeaderHeight;\n newHeaderTop = 0;\n newPageMarginTop = 0;\n } else {\n if ((!update) && (currentPageScrollTop == headerNoNavbar) && (pageScrollTop >= headerNoNavbar)) {\n return;\n }\n if (update) {\n // Just changed from <= screenmd.\n headerHeight = header.getBoundingClientRect().height;\n if (navbar !== null) {\n navbarHeight = navbar.getBoundingClientRect().height;\n } // Else will never change from 0 at init!\n headerNoNavbar = headerHeight - navbarHeight;\n }\n if (pageScrollTop > headerNoNavbar) {\n pageScrollTop = headerNoNavbar;\n }\n newHeaderTop = -pageScrollTop;\n newPageMarginTop = headerHeight - pageScrollTop;\n }\n currentPageScrollTop = pageScrollTop;\n\n if ((update) || (newHeaderTop != headerTop)) {\n header.style.top = newHeaderTop + 'px';\n headerTop = newHeaderTop;\n }\n if ((update) || (newPageMarginTop != pageMarginTop)) {\n page.style.marginTop = newPageMarginTop + 'px';\n pageMarginTop = newPageMarginTop;\n }\n\n if ((courseIndex) || (sidePost)) {\n if (windowWidth < screenmd) {\n newDrawerPaddingTop = 0;\n } else {\n newDrawerPaddingTop = headerHeight - pageScrollTop;\n }\n if ((update) || (newDrawerPaddingTop != drawerPaddingTop)) {\n drawerPaddingTop = newDrawerPaddingTop;\n if (courseIndex) {\n courseIndex.style.paddingTop = drawerPaddingTop + 'px';\n }\n if (sidePost) {\n sidePost.style.paddingTop = drawerPaddingTop + 'px';\n }\n if ((courseIndex) || (sidePost)) {\n if (windowWidth < screenmd) {\n for (let dt = 0; dt < drawerTogglers.length; dt++) {\n drawerTogglers[dt].style.top = null;\n }\n } else {\n for (let dt = 0; dt < drawerTogglers.length; dt++) {\n drawerTogglers[dt].style.top = (drawerPaddingTop + 22) + 'px';\n }\n }\n }\n }\n }\n };\n makeNavbarSticky(true);\n if (courseIndex) {\n courseIndex.classList.remove(\"d-none\");\n }\n if (sidePost) {\n sidePost.classList.remove(\"d-none\");\n }\n\n // When the user scrolls the page, execute makeNavbarSticky().\n page.onscroll = function () { makeNavbarSticky(); };\n\n $(window).resize(function () {\n windowWidth = $(window).width();\n if (windowWidth < screensm) {\n if (currentWindowSize != 1) {\n makeNavbarSticky(true);\n currentWindowSize = 1;\n }\n } else if (windowWidth < screenmd) {\n if (currentWindowSize != 2) {\n makeNavbarSticky(true);\n currentWindowSize = 2;\n }\n } else {\n if (currentWindowSize != 3) {\n currentWindowSize = 3;\n }\n // At screenmd and above, window width changes can change the height of the header.\n makeNavbarSticky(true);\n }\n if (windowWidth < screenmd) {\n if (isFixed === 0) {\n header.classList.remove(\"sticky\");\n body.addClass(\"page-header-margin\");\n isFixed = 1;\n }\n } else {\n if (isFixed === 1) {\n header.classList.add(\"sticky\");\n body.removeClass(\"page-header-margin\");\n isFixed = 0;\n }\n }\n });\n }\n\n $('.moodlewidth').click(function () {\n if (body.hasClass('fullin')) {\n body.removeClass('fullin');\n AdaptableUtil.setUserPreference('theme_adaptable_full', 'nofull');\n } else {\n body.addClass('fullin');\n AdaptableUtil.setUserPreference('theme_adaptable_full', 'fullin');\n }\n });\n\n $('#openoverlaymenu').click(function () {\n $('#conditionalmenu').toggleClass('open');\n });\n $('#overlaymenuclose').click(function () {\n $('#conditionalmenu').toggleClass('open');\n });\n\n // Bootstrap sub-menu functionality.\n // See: https://bootstrapthemes.co/demo/resource/bootstrap-4-multi-dropdown-hover-navbar/.\n\n $('.dropdown-menu a.dropdown-toggle').on('click', function () {\n var $el = $(this);\n var $parent = $(this).offsetParent(\".dropdown-menu\");\n if (!$(this).next().hasClass('show')) {\n $(this).parents('.dropdown-menu').first().find('.show').removeClass(\"show\");\n }\n var $subMenu = $(this).next(\".dropdown-menu\");\n $subMenu.toggleClass('show');\n\n $(this).parent(\"li\").toggleClass('show');\n\n $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function () {\n $('.dropdown-menu .show').removeClass(\"show\");\n });\n\n if (!$parent.parent().hasClass('navbar-nav')) {\n $el.next().css({ \"top\": $el[0].offsetTop, \"left\": $parent.outerWidth() - 4 });\n }\n\n return false;\n });\n};\n\nexport const init = (data) => {\n log.debug('Adaptable ES6 init');\n jqueryeasingInit();\n pace.start({\n document: false\n });\n /* Conditional javascript to resolve anchor link clicking issue with sticky navbar.\n in old bootstrap version. Re: issue #919.\n Original issue / solution discussion here: https://github.com/twbs/bootstrap/issues/1768. */\n if (data.stickynavbar) {\n var shiftWindow = function () { scrollBy(0, -50); };\n if (location.hash) {\n shiftWindow();\n }\n window.addEventListener(\"hashchange\", shiftWindow);\n }\n if (document.readyState !== 'loading') {\n log.debug(\"Adaptable ES6 init DOM content already loaded\");\n adaptable();\n options(data);\n } else {\n log.debug(\"Adaptable ES6 init JS DOM content not loaded\");\n document.addEventListener('DOMContentLoaded', function () {\n log.debug(\"Adaptable ES6 init JS DOM content loaded\");\n adaptable();\n options(data);\n });\n }\n};\n"],"names":["adaptable","debug","not","addClass","click","event","preventDefault","to","window","scrollTop","sessionStorage","setItem","url","this","prop","location","replace","scrollTo","getItem","removeItem","e","name","bttOn","st","bttScrollCheck","fadeIn","fadeOut","scroll","animate","hash","hasClass","anchorTop","offset","top","css","height","options","data","body","navbar","document","getElementById","stickynavbar","screenmd","screensm","currentWindowSize","windowWidth","width","header","aboveHeader","courseIndex","sidePost","drawerTogglers","getElementsByClassName","page","pageScrollTop","currentPageScrollTop","headerHeight","headerNoNavbar","navbarHeight","getBoundingClientRect","aboveHeaderHeight","drawerPaddingTop","newDrawerPaddingTop","pageMarginTop","newPageMarginTop","headerTop","newHeaderTop","isFixed","classList","remove","add","removeClass","makeNavbarSticky","update","style","marginTop","paddingTop","dt","length","onscroll","resize","AdaptableUtil","setUserPreference","toggleClass","on","$el","$parent","offsetParent","next","parents","first","find","parent","offsetTop","outerWidth","start","shiftWindow","scrollBy","addEventListener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,OAAO3D,SAAS,6BACvBjB,MAAM6E,QAAQ,kBAAkBC,QAAQC,KAAK,SAASpB,YAAY,SAEzD,mBAAE3D,MAAM4E,KAAK,kBACnBL,YAAY,4BAEnBvE,MAAMgF,OAAO,MAAMT,YAAY,4BAE/BvE,MAAM6E,QAAQ,6BAA6BL,GAAG,sBAAsB,+BAChE,wBAAwBb,YAAY,WAGrCe,QAAQM,SAAS/D,SAAS,eAC3BwD,IAAIG,OAAOvD,IAAI,KAASoD,IAAI,GAAGQ,eAAmBP,QAAQQ,aAAe,KAGtE,oBAIM1D,uBACbpC,MAAM,gEAEL+F,MAAM,CACPxD,UAAU,IAKVH,KAAKK,aAAc,KACfuD,YAAc,WAAcC,SAAS,GAAI,KACzCnF,SAASc,MACToE,cAEJzF,OAAO2F,iBAAiB,aAAcF,aAEd,YAAxBzD,SAAS4D,yBACLnG,MAAM,iDACVD,YACAoC,QAAQC,qBAEJpC,MAAM,gDACVuC,SAAS2D,iBAAiB,oBAAoB,wBACtClG,MAAM,4CACVD,YACAoC,QAAQC"} \ No newline at end of file +{"version":3,"file":"adaptable.min.js","sources":["../src/adaptable.js"],"sourcesContent":["//\n// This file is part of Adaptable theme for moodle\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n//\n\n// Adaptable main JS file\n//\n// @package theme_adaptable\n// @copyright 2015-2019 Jeremy Hopkins (Coventry University)\n// @copyright 2015-2019 Fernando Acedo (3-bits.com)\n// @copyright 2018-2019 Manoj Solanki (Coventry University)\n// @copyright 2019 G J Barnard\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport $ from 'jquery';\nimport jqueryeasingInit from 'theme_adaptable/jqueryeasing';\nimport * as AdaptableUtil from 'theme_adaptable/util';\nimport log from 'core/log';\n\nconst adaptable = () => {\n log.debug('Adaptable ES6 adaptable');\n\n // Breadcrumb.\n $(\".breadcrumb li:not(:last-child) span\").not('.separator').addClass('');\n $(\".breadcrumb li:last-child\").addClass(\"lastli\");\n\n // Edit button keep position. Needs session storage!\n try {\n $('.context-header-settings-menu .dropdown-menu .dropdown-item a[href*=\"edit\"], #editingbutton a')\n .click(function (event) {\n event.preventDefault();\n\n var to = $(window).scrollTop();\n sessionStorage.setItem('scrollTo', to);\n var url = $(this).prop('href');\n window.location.replace(url);\n\n return false;\n });\n var scrollTo = sessionStorage.getItem('scrollTo');\n if (scrollTo !== null) {\n window.scrollTo(0, scrollTo);\n sessionStorage.removeItem('scrollTo');\n }\n } catch (e) {\n log.debug('Adaptable: Session storage exception: ' + e.name);\n }\n\n // Scroll to top.\n const bttOffset = 150;\n const bttDuration = 500;\n let bttOn;\n const scrollDuration = 500;\n let st = $('#page').scrollTop();\n if (st > bttOffset) {\n bttOn = false;\n } else {\n bttOn = true;\n }\n var bttScrollCheck = function () {\n st = $('#page').scrollTop();\n if (st > bttOffset) {\n if (bttOn == false) {\n bttOn = true;\n $('#back-to-top').fadeIn(bttDuration);\n }\n } else {\n if (bttOn == true) {\n bttOn = false;\n $('#back-to-top').fadeOut(bttDuration);\n }\n }\n };\n bttScrollCheck();\n $('#page').scroll(function () {\n bttScrollCheck();\n });\n\n $('#back-to-top').click(function (event) {\n event.preventDefault();\n $('#page').animate({ scrollTop: 0 }, scrollDuration);\n return false;\n });\n\n // Anchor.\n if (window.location.hash) {\n if ($(\"body\").hasClass(\"pagelayout-course\")) {\n var anchorTop = $(window.location.hash).offset().top;\n $('html, body').animate({ scrollTop: anchorTop - 102 }, scrollDuration);\n }\n }\n\n // New for every three.\n if ($('header').css(\"position\") == \"fixed\") {\n $('.outercont').css('padding-top', $('header').height());\n }\n};\n\nconst options = (data) => {\n log.debug('Adaptable ES6 options');\n var body = $(\"body\");\n // Get the navbar, if present.\n var navbar = document.getElementById(\"main-navbar\");\n\n if (data.stickynavbar) {\n /* New way to handle sticky navbar requirement.\n Simply taken from https://www.w3schools.com/howto/howto_js_navbar_sticky.asp. */\n\n const screenmd = 992;\n const screensm = 768;\n var windowWidth = $(window).width();\n var currentWindowSize;\n if (windowWidth < screensm) {\n currentWindowSize = 1;\n } else if (windowWidth < screenmd) {\n currentWindowSize = 2;\n } else {\n currentWindowSize = 3;\n }\n\n // Container.\n var header = document.getElementById(\"adaptable-page-header-wrapper\");\n var aboveHeader = document.getElementById(\"header1\");\n if (!aboveHeader) {\n aboveHeader = document.getElementById(\"header2\");\n }\n\n // Drawers.\n var courseIndex = document.getElementById(\"theme_adaptable-drawers-courseindex\");\n var sidePost = document.getElementById(\"theme_adaptable-drawers-sidepost\");\n var drawerTogglers = document.getElementsByClassName(\"drawer-toggler\");\n\n // Page.\n var page = document.getElementById(\"page\");\n\n // Adjustments.\n var pageScrollTop = page.scrollTop;\n var currentPageScrollTop = pageScrollTop;\n var headerHeight = 0;\n var headerNoNavbar = 0;\n var navbarHeight = 0;\n if (navbar !== null) {\n navbarHeight = navbar.getBoundingClientRect().height;\n }\n var aboveHeaderHeight = aboveHeader.getBoundingClientRect().height;\n\n var drawerPaddingTop = 0;\n var newDrawerPaddingTop = 0;\n var pageMarginTop = 0;\n var newPageMarginTop = 0;\n var headerTop = 0;\n var newHeaderTop = 0;\n\n var isFixed = 0;\n /* Ok, here's an odd one... desktops need to use the 'inner' variables and mobiles the 'outer'\n to be accurate! But... I've (GB) found that the jQuery height and width functions adapt and\n report close to correct values regardless of device, so use them instead without complicated\n device detection here! Update: postion:fixed does not work on mobiles at the moment so won't\n be for such, left comment for future info. */\n\n /* Top navbar stickyness.\n As per above comments, some issues noted with using CSS position: fixed, but these seem to mostly be constrained\n to older browsers (inc. mobile browsers). May need to revisit!\n https://caniuse.com/#feat=css-fixed */\n if (windowWidth < screenmd) {\n header.classList.remove(\"sticky\");\n body.addClass(\"page-header-margin\");\n isFixed = 1;\n } else {\n header.classList.add(\"sticky\");\n body.removeClass(\"page-header-margin\");\n }\n\n var makeNavbarSticky = function (update = false) {\n pageScrollTop = page.scrollTop;\n\n if (windowWidth < screenmd) {\n if ((!update) && (currentPageScrollTop == aboveHeaderHeight) && (pageScrollTop >= aboveHeaderHeight)) {\n return;\n }\n pageScrollTop = aboveHeaderHeight;\n newHeaderTop = 0;\n newPageMarginTop = 0;\n } else {\n if ((!update) && (currentPageScrollTop == headerNoNavbar) && (pageScrollTop >= headerNoNavbar)) {\n return;\n }\n if (update) {\n // Just changed from <= screenmd.\n headerHeight = header.getBoundingClientRect().height;\n if (navbar !== null) {\n navbarHeight = navbar.getBoundingClientRect().height;\n } // Else will never change from 0 at init!\n headerNoNavbar = headerHeight - navbarHeight;\n }\n if (pageScrollTop > headerNoNavbar) {\n pageScrollTop = headerNoNavbar;\n }\n newHeaderTop = -pageScrollTop;\n newPageMarginTop = headerHeight - pageScrollTop;\n }\n currentPageScrollTop = pageScrollTop;\n\n if ((update) || (newHeaderTop != headerTop)) {\n header.style.top = newHeaderTop + 'px';\n headerTop = newHeaderTop;\n }\n if ((update) || (newPageMarginTop != pageMarginTop)) {\n page.style.marginTop = newPageMarginTop + 'px';\n pageMarginTop = newPageMarginTop;\n }\n\n if ((courseIndex) || (sidePost)) {\n if (windowWidth < screenmd) {\n newDrawerPaddingTop = 0;\n } else {\n newDrawerPaddingTop = headerHeight - pageScrollTop;\n }\n if ((update) || (newDrawerPaddingTop != drawerPaddingTop)) {\n drawerPaddingTop = newDrawerPaddingTop;\n if (courseIndex) {\n courseIndex.style.paddingTop = drawerPaddingTop + 'px';\n }\n if (sidePost) {\n sidePost.style.paddingTop = drawerPaddingTop + 'px';\n }\n if ((courseIndex) || (sidePost)) {\n if (windowWidth < screenmd) {\n for (let dt = 0; dt < drawerTogglers.length; dt++) {\n drawerTogglers[dt].style.top = null;\n }\n } else {\n for (let dt = 0; dt < drawerTogglers.length; dt++) {\n drawerTogglers[dt].style.top = (drawerPaddingTop + 22) + 'px';\n }\n }\n }\n }\n }\n };\n makeNavbarSticky(true);\n if (courseIndex) {\n courseIndex.classList.remove(\"d-none\");\n }\n if (sidePost) {\n sidePost.classList.remove(\"d-none\");\n }\n\n // When the user scrolls the page, execute makeNavbarSticky().\n page.onscroll = function () { makeNavbarSticky(); };\n\n $(window).resize(function () {\n windowWidth = $(window).width();\n if (windowWidth < screensm) {\n if (currentWindowSize != 1) {\n makeNavbarSticky(true);\n currentWindowSize = 1;\n }\n } else if (windowWidth < screenmd) {\n if (currentWindowSize != 2) {\n makeNavbarSticky(true);\n currentWindowSize = 2;\n }\n } else {\n if (currentWindowSize != 3) {\n currentWindowSize = 3;\n }\n // At screenmd and above, window width changes can change the height of the header.\n makeNavbarSticky(true);\n }\n if (windowWidth < screenmd) {\n if (isFixed === 0) {\n header.classList.remove(\"sticky\");\n body.addClass(\"page-header-margin\");\n isFixed = 1;\n }\n } else {\n if (isFixed === 1) {\n header.classList.add(\"sticky\");\n body.removeClass(\"page-header-margin\");\n isFixed = 0;\n }\n }\n });\n }\n\n $('.moodlewidth').click(function () {\n if (body.hasClass('fullin')) {\n body.removeClass('fullin');\n AdaptableUtil.setUserPreference('theme_adaptable_full', 'nofull');\n } else {\n body.addClass('fullin');\n AdaptableUtil.setUserPreference('theme_adaptable_full', 'fullin');\n }\n });\n\n $('#openoverlaymenu').click(function () {\n $('#conditionalmenu').toggleClass('open');\n });\n $('#overlaymenuclose').click(function () {\n $('#conditionalmenu').toggleClass('open');\n });\n\n // Bootstrap sub-menu functionality.\n // See: https://bootstrapthemes.co/demo/resource/bootstrap-4-multi-dropdown-hover-navbar/.\n\n $('.dropdown-menu a.dropdown-toggle').on('click', function () {\n var $el = $(this);\n var $parent = $(this).offsetParent(\".dropdown-menu\");\n if (!$(this).next().hasClass('show')) {\n $(this).parents('.dropdown-menu').first().find('.show').removeClass(\"show\");\n }\n var $subMenu = $(this).next(\".dropdown-menu\");\n $subMenu.toggleClass('show');\n\n $(this).parent(\"li\").toggleClass('show');\n\n $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function () {\n $('.dropdown-menu .show').removeClass(\"show\");\n });\n\n if (!$parent.parent().hasClass('navbar-nav')) {\n $el.next().css({ \"top\": $el[0].offsetTop, \"left\": $parent.outerWidth() - 4 });\n }\n\n return false;\n });\n};\n\nexport const init = (data) => {\n log.debug('Adaptable ES6 init');\n jqueryeasingInit();\n /* Conditional javascript to resolve anchor link clicking issue with sticky navbar.\n in old bootstrap version. Re: issue #919.\n Original issue / solution discussion here: https://github.com/twbs/bootstrap/issues/1768. */\n if (data.stickynavbar) {\n var shiftWindow = function () { scrollBy(0, -50); };\n if (location.hash) {\n shiftWindow();\n }\n window.addEventListener(\"hashchange\", shiftWindow);\n }\n if (document.readyState !== 'loading') {\n log.debug(\"Adaptable ES6 init DOM content already loaded\");\n adaptable();\n options(data);\n } else {\n log.debug(\"Adaptable ES6 init JS DOM content not loaded\");\n document.addEventListener('DOMContentLoaded', function () {\n log.debug(\"Adaptable ES6 init JS DOM content loaded\");\n adaptable();\n options(data);\n });\n }\n};\n"],"names":["adaptable","debug","not","addClass","click","event","preventDefault","to","window","scrollTop","sessionStorage","setItem","url","this","prop","location","replace","scrollTo","getItem","removeItem","e","name","bttOn","st","bttScrollCheck","fadeIn","fadeOut","scroll","animate","hash","hasClass","anchorTop","offset","top","css","height","options","data","body","navbar","document","getElementById","stickynavbar","screenmd","screensm","currentWindowSize","windowWidth","width","header","aboveHeader","courseIndex","sidePost","drawerTogglers","getElementsByClassName","page","pageScrollTop","currentPageScrollTop","headerHeight","headerNoNavbar","navbarHeight","getBoundingClientRect","aboveHeaderHeight","drawerPaddingTop","newDrawerPaddingTop","pageMarginTop","newPageMarginTop","headerTop","newHeaderTop","isFixed","classList","remove","add","removeClass","makeNavbarSticky","update","style","marginTop","paddingTop","dt","length","onscroll","resize","AdaptableUtil","setUserPreference","toggleClass","on","$el","$parent","offsetParent","next","parents","first","find","parent","offsetTop","outerWidth","shiftWindow","scrollBy","addEventListener","readyState"],"mappings":";;23BAkCMA,UAAY,kBACVC,MAAM,+CAGR,wCAAwCC,IAAI,cAAcC,SAAS,wBACnE,6BAA6BA,SAAS,kCAIlC,iGACGC,OAAM,SAAUC,OACbA,MAAMC,qBAEFC,IAAK,mBAAEC,QAAQC,YACnBC,eAAeC,QAAQ,WAAYJ,QAC/BK,KAAM,mBAAEC,MAAMC,KAAK,eACvBN,OAAOO,SAASC,QAAQJ,MAEjB,SAEXK,SAAWP,eAAeQ,QAAQ,YACrB,OAAbD,WACAT,OAAOS,SAAS,EAAGA,UACnBP,eAAeS,WAAW,aAEhC,MAAOC,gBACDnB,MAAM,yCAA2CmB,EAAEC,UAMvDC,UAEAC,IAAK,mBAAE,SAASd,YAEhBa,QADAC,GALc,SAUdC,eAAiB,WACjBD,IAAK,mBAAE,SAASd,YACZc,GAZU,IAaG,GAATD,QACAA,OAAQ,sBACN,gBAAgBG,OAdV,MAiBC,GAATH,QACAA,OAAQ,sBACN,gBAAgBI,QAnBV,UAuBpBF,qCACE,SAASG,QAAO,WACdH,wCAGF,gBAAgBpB,OAAM,SAAUC,cAC9BA,MAAMC,qCACJ,SAASsB,QAAQ,CAAEnB,UAAW,GA5Bb,MA6BZ,KAIPD,OAAOO,SAASc,OACZ,mBAAE,QAAQC,SAAS,qBAAsB,KACrCC,WAAY,mBAAEvB,OAAOO,SAASc,MAAMG,SAASC,wBAC/C,cAAcL,QAAQ,CAAEnB,UAAWsB,UAAY,KApClC,KAyCY,UAA/B,mBAAE,UAAUG,IAAI,iCACd,cAAcA,IAAI,eAAe,mBAAE,UAAUC,WAIjDC,QAAWC,oBACTpC,MAAM,6BACNqC,MAAO,mBAAE,QAETC,OAASC,SAASC,eAAe,kBAEjCJ,KAAKK,aAA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hF,OAAM,+BACvB,oBAAoBgF,YAAY,+BAMpC,oCAAoCC,GAAG,SAAS,eAC1CC,KAAM,mBAAEzE,MACR0E,SAAU,mBAAE1E,MAAM2E,aAAa,yBAC9B,mBAAE3E,MAAM4E,OAAO3D,SAAS,6BACvBjB,MAAM6E,QAAQ,kBAAkBC,QAAQC,KAAK,SAASpB,YAAY,SAEzD,mBAAE3D,MAAM4E,KAAK,kBACnBL,YAAY,4BAEnBvE,MAAMgF,OAAO,MAAMT,YAAY,4BAE/BvE,MAAM6E,QAAQ,6BAA6BL,GAAG,sBAAsB,+BAChE,wBAAwBb,YAAY,WAGrCe,QAAQM,SAAS/D,SAAS,eAC3BwD,IAAIG,OAAOvD,IAAI,KAASoD,IAAI,GAAGQ,eAAmBP,QAAQQ,aAAe,KAGtE,oBAIM1D,uBACbpC,MAAM,kDAKNoC,KAAKK,aAAc,KACfsD,YAAc,WAAcC,SAAS,GAAI,KACzClF,SAASc,MACTmE,cAEJxF,OAAO0F,iBAAiB,aAAcF,aAEd,YAAxBxD,SAAS2D,yBACLlG,MAAM,iDACVD,YACAoC,QAAQC,qBAEJpC,MAAM,gDACVuC,SAAS0D,iBAAiB,oBAAoB,wBACtCjG,MAAM,4CACVD,YACAoC,QAAQC"} \ No newline at end of file diff --git a/amd/build/collapseblock.min.js b/amd/build/collapseblock.min.js index 852d2fe..3fa1f54 100644 --- a/amd/build/collapseblock.min.js +++ b/amd/build/collapseblock.min.js @@ -1,5 +1,3 @@ -define("theme_adaptable/collapseblock",["exports","jquery","theme_adaptable/util","core/log"],(function(_exports,_jquery,AdaptableUtil,_log){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}} -// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. -Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.collapseBlockInit=void 0,_jquery=_interopRequireDefault(_jquery),AdaptableUtil=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(AdaptableUtil),_log=_interopRequireDefault(_log);class CollapseBlock{static noInit=!0;static collapseBlock(){CollapseBlock.noInit&&(CollapseBlock.noInit=!1,(0,_jquery.default)(".block-collapsible").click((function(){var instanceId=(0,_jquery.default)(this).data("instanceid"),blockInstance=(0,_jquery.default)("#inst"+instanceId);(0,_jquery.default)("#inst"+instanceId+" .content").slideToggle("slow",(function(){blockInstance.hasClass("hidden")?(blockInstance.removeClass("hidden"),AdaptableUtil.setUserPreference("block"+instanceId+"hidden",0)):(blockInstance.addClass("hidden"),AdaptableUtil.setUserPreference("block"+instanceId+"hidden",1))}))})),_log.default.debug("Adaptable Collapse Block ES6 collapseBlock"))}}_exports.collapseBlockInit=()=>{"loading"!==document.readyState?CollapseBlock.collapseBlock():document.addEventListener("DOMContentLoaded",(function(){CollapseBlock.collapseBlock()}))}})); +define("theme_adaptable/collapseblock",["exports","jquery","theme_adaptable/util","core/log"],(function(_exports,_jquery,AdaptableUtil,_log){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.collapseBlockInit=void 0,_jquery=_interopRequireDefault(_jquery),AdaptableUtil=function(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}newObj.default=obj,cache&&cache.set(obj,newObj);return newObj}(AdaptableUtil),_log=_interopRequireDefault(_log);class CollapseBlock{static collapseBlock(){CollapseBlock.noInit&&(CollapseBlock.noInit=!1,(0,_jquery.default)(".block-collapsible").click((function(){var instanceId=(0,_jquery.default)(this).data("instanceid"),blockInstance=(0,_jquery.default)("#inst"+instanceId);(0,_jquery.default)("#inst"+instanceId+" .content").slideToggle("slow",(function(){blockInstance.hasClass("hidden")?(blockInstance.removeClass("hidden"),AdaptableUtil.setUserPreference("block"+instanceId+"hidden",0)):(blockInstance.addClass("hidden"),AdaptableUtil.setUserPreference("block"+instanceId+"hidden",1))}))})),_log.default.debug("Adaptable Collapse Block ES6 collapseBlock"))}}var obj,key,value;value=!0,(key="noInit")in(obj=CollapseBlock)?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value;_exports.collapseBlockInit=()=>{"loading"!==document.readyState?CollapseBlock.collapseBlock():document.addEventListener("DOMContentLoaded",(function(){CollapseBlock.collapseBlock()}))}})); //# sourceMappingURL=collapseblock.min.js.map \ No newline at end of file diff --git a/amd/build/collapseblock.min.js.map b/amd/build/collapseblock.min.js.map index 44b67ee..77dd457 100644 --- a/amd/build/collapseblock.min.js.map +++ b/amd/build/collapseblock.min.js.map @@ -1 +1 @@ -{"version":3,"file":"collapseblock.min.js","sources":["../src/collapseblock.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n//\n// Collapse block.\n//\n// @module theme_adaptable/collapseblock\n// @copyright 2023 G J Barnard.\n// @author G J Barnard -\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport $ from 'jquery';\nimport * as AdaptableUtil from 'theme_adaptable/util';\nimport log from 'core/log';\n\n/**\n * Collapse Block class.\n */\nclass CollapseBlock {\n static noInit = true;\n\n static collapseBlock() {\n if (CollapseBlock.noInit) {\n CollapseBlock.noInit = false;\n $('.block-collapsible').click(function() {\n var instanceId = $(this).data('instanceid');\n var blockInstance = $('#inst' + instanceId);\n\n $('#inst' + instanceId + ' .content').slideToggle('slow', function() {\n if (blockInstance.hasClass('hidden')) {\n blockInstance.removeClass('hidden');\n AdaptableUtil.setUserPreference('block' + instanceId + 'hidden', 0);\n } else {\n blockInstance.addClass('hidden');\n AdaptableUtil.setUserPreference('block' + instanceId + 'hidden', 1);\n }\n });\n });\n log.debug('Adaptable Collapse Block ES6 collapseBlock');\n }\n }\n}\n\n/**\n * Init.\n */\nexport const collapseBlockInit = () => {\n if (document.readyState !== 'loading') {\n CollapseBlock.collapseBlock();\n } else {\n document.addEventListener('DOMContentLoaded', function () {\n CollapseBlock.collapseBlock();\n });\n }\n};\n"],"names":["CollapseBlock","noInit","click","instanceId","this","data","blockInstance","slideToggle","hasClass","removeClass","AdaptableUtil","setUserPreference","addClass","debug","document","readyState","collapseBlock","addEventListener"],"mappings":";;o1BAiCMA,6BACc,yBAGRA,cAAcC,SACdD,cAAcC,QAAS,sBACrB,sBAAsBC,OAAM,eACtBC,YAAa,mBAAEC,MAAMC,KAAK,cAC1BC,eAAgB,mBAAE,QAAUH,gCAE9B,QAAUA,WAAa,aAAaI,YAAY,QAAQ,WAClDD,cAAcE,SAAS,WACvBF,cAAcG,YAAY,UAC1BC,cAAcC,kBAAkB,QAAUR,WAAa,SAAU,KAEjEG,cAAcM,SAAS,UACvBF,cAAcC,kBAAkB,QAAUR,WAAa,SAAU,uBAIzEU,MAAM,2EAQW,KACD,YAAxBC,SAASC,WACTf,cAAcgB,gBAEdF,SAASG,iBAAiB,oBAAoB,WAC1CjB,cAAcgB"} \ No newline at end of file +{"version":3,"file":"collapseblock.min.js","sources":["../src/collapseblock.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n//\n// Collapse block.\n//\n// @module theme_adaptable/collapseblock\n// @copyright 2023 G J Barnard.\n// @author G J Barnard -\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport $ from 'jquery';\nimport * as AdaptableUtil from 'theme_adaptable/util';\nimport log from 'core/log';\n\n/**\n * Collapse Block class.\n */\nclass CollapseBlock {\n static noInit = true;\n\n static collapseBlock() {\n if (CollapseBlock.noInit) {\n CollapseBlock.noInit = false;\n $('.block-collapsible').click(function() {\n var instanceId = $(this).data('instanceid');\n var blockInstance = $('#inst' + instanceId);\n\n $('#inst' + instanceId + ' .content').slideToggle('slow', function() {\n if (blockInstance.hasClass('hidden')) {\n blockInstance.removeClass('hidden');\n AdaptableUtil.setUserPreference('block' + instanceId + 'hidden', 0);\n } else {\n blockInstance.addClass('hidden');\n AdaptableUtil.setUserPreference('block' + instanceId + 'hidden', 1);\n }\n });\n });\n log.debug('Adaptable Collapse Block ES6 collapseBlock');\n }\n }\n}\n\n/**\n * Init.\n */\nexport const collapseBlockInit = () => {\n if (document.readyState !== 'loading') {\n CollapseBlock.collapseBlock();\n } else {\n document.addEventListener('DOMContentLoaded', function () {\n CollapseBlock.collapseBlock();\n });\n }\n};\n"],"names":["CollapseBlock","noInit","click","instanceId","this","data","blockInstance","slideToggle","hasClass","removeClass","AdaptableUtil","setUserPreference","addClass","debug","document","readyState","collapseBlock","addEventListener"],"mappings":"s0CAiCMA,qCAIMA,cAAcC,SACdD,cAAcC,QAAS,sBACrB,sBAAsBC,OAAM,eACtBC,YAAa,mBAAEC,MAAMC,KAAK,cAC1BC,eAAgB,mBAAE,QAAUH,gCAE9B,QAAUA,WAAa,aAAaI,YAAY,QAAQ,WAClDD,cAAcE,SAAS,WACvBF,cAAcG,YAAY,UAC1BC,cAAcC,kBAAkB,QAAUR,WAAa,SAAU,KAEjEG,cAAcM,SAAS,UACvBF,cAAcC,kBAAkB,QAAUR,WAAa,SAAU,uBAIzEU,MAAM,yEAnBF,uBADdb,gJA4B2B,KACD,YAAxBc,SAASC,WACTf,cAAcgB,gBAEdF,SAASG,iBAAiB,oBAAoB,WAC1CjB,cAAcgB"} \ No newline at end of file diff --git a/amd/build/icon_system_fontawesome.min.js b/amd/build/icon_system_fontawesome.min.js index 6f4b4c4..ba9998a 100644 --- a/amd/build/icon_system_fontawesome.min.js +++ b/amd/build/icon_system_fontawesome.min.js @@ -1,5 +1,3 @@ -define("theme_adaptable/icon_system_fontawesome",["exports","core/ajax","core/localstorage","core/icon_system","core/mustache","core/config","core/url"],(function(_exports,_ajax,_localstorage,_icon_system,Mustache,Config,Url){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}} -// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. -Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_localstorage=_interopRequireDefault(_localstorage),_icon_system=_interopRequireDefault(_icon_system),Mustache=_interopRequireWildcard(Mustache),Config=_interopRequireWildcard(Config),Url=_interopRequireWildcard(Url);class IconSystemFontawesome extends _icon_system.default{static staticMap=null;static fetchPromise=null;static cacheKey=`core_iconsystem/theme/${Config.theme}/core/iconmap-fontawesome`;init(){return IconSystemFontawesome.staticMap||this.getMapFromCache()?Promise.resolve(this):IconSystemFontawesome.fetchPromise?IconSystemFontawesome.fetchPromise:this.fetchMapFromServer()}getMapFromCache(){const map=_localstorage.default.get(IconSystemFontawesome.cacheKey);return map&&(IconSystemFontawesome.staticMap=new Map(JSON.parse(map))),IconSystemFontawesome.staticMap}_fetchMapFromServer(){return(0,_ajax.call)([{methodname:"theme_adaptable_output_load_fontawesome_icon_map",args:{}}],!0,!1,!1,0,Config.themerev)[0]}async fetchMapFromServer(){return IconSystemFontawesome.fetchPromise=(async()=>{const mapData=await this._fetchMapFromServer();return IconSystemFontawesome.staticMap=new Map(Object.entries(mapData).map((_ref=>{let[,value]=_ref;return[`${value.component}/${value.pix}`,value.to]}))),_localstorage.default.set(IconSystemFontawesome.cacheKey,JSON.stringify(Array.from(IconSystemFontawesome.staticMap.entries()))),this})(),IconSystemFontawesome.fetchPromise}renderIcon(key,component,title,template){const iconKey=`${component}/${key}`,mappedIcon=IconSystemFontawesome.staticMap.get(iconKey),context={title:title,unmappedIcon:this.getUnmappedIcon(mappedIcon,key,component,title),alt:title,key:mappedIcon};return void 0!==title&&""!==title||(context["aria-hidden"]=!0),Mustache.render(template,context).trim()}getUnmappedIcon(mappedIcon,key,component,title){return mappedIcon?null:{attributes:[{name:"src",value:Url.imageUrl(key,component)},{name:"alt",value:title},{name:"title",value:title}]}}getTemplateName(){return"theme_adaptable/pix_icon_fontawesome"}}return _exports.default=IconSystemFontawesome,_exports.default})); +define("theme_adaptable/icon_system_fontawesome",["exports","core/ajax","core/localstorage","core/icon_system","core/mustache","core/config","core/url"],(function(_exports,_ajax,_localstorage,_icon_system,Mustache,Config,Url){function _getRequireWildcardCache(nodeInterop){if("function"!=typeof WeakMap)return null;var cacheBabelInterop=new WeakMap,cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule)return obj;if(null===obj||"object"!=typeof obj&&"function"!=typeof obj)return{default:obj};var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj))return cache.get(obj);var newObj={},hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj)if("default"!==key&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;desc&&(desc.get||desc.set)?Object.defineProperty(newObj,key,desc):newObj[key]=obj[key]}return newObj.default=obj,cache&&cache.set(obj,newObj),newObj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,_localstorage=_interopRequireDefault(_localstorage),_icon_system=_interopRequireDefault(_icon_system),Mustache=_interopRequireWildcard(Mustache),Config=_interopRequireWildcard(Config),Url=_interopRequireWildcard(Url);class IconSystemFontawesome extends _icon_system.default{init(){return IconSystemFontawesome.staticMap||this.getMapFromCache()?Promise.resolve(this):IconSystemFontawesome.fetchPromise?IconSystemFontawesome.fetchPromise:this.fetchMapFromServer()}getMapFromCache(){const map=_localstorage.default.get(IconSystemFontawesome.cacheKey);return map&&(IconSystemFontawesome.staticMap=new Map(JSON.parse(map))),IconSystemFontawesome.staticMap}_fetchMapFromServer(){return(0,_ajax.call)([{methodname:"theme_adaptable_output_load_fontawesome_icon_map",args:{}}],!0,!1,!1,0,Config.themerev)[0]}async fetchMapFromServer(){return IconSystemFontawesome.fetchPromise=(async()=>{const mapData=await this._fetchMapFromServer();return IconSystemFontawesome.staticMap=new Map(Object.entries(mapData).map((_ref=>{let[,value]=_ref;return["".concat(value.component,"/").concat(value.pix),value.to]}))),_localstorage.default.set(IconSystemFontawesome.cacheKey,JSON.stringify(Array.from(IconSystemFontawesome.staticMap.entries()))),this})(),IconSystemFontawesome.fetchPromise}renderIcon(key,component,title,template){const iconKey="".concat(component,"/").concat(key),mappedIcon=IconSystemFontawesome.staticMap.get(iconKey),context={title:title,unmappedIcon:this.getUnmappedIcon(mappedIcon,key,component,title),alt:title,key:mappedIcon};return void 0!==title&&""!==title||(context["aria-hidden"]=!0),Mustache.render(template,context).trim()}getUnmappedIcon(mappedIcon,key,component,title){return mappedIcon?null:{attributes:[{name:"src",value:Url.imageUrl(key,component)},{name:"alt",value:title},{name:"title",value:title}]}}getTemplateName(){return"theme_adaptable/pix_icon_fontawesome"}}return _exports.default=IconSystemFontawesome,_defineProperty(IconSystemFontawesome,"staticMap",null),_defineProperty(IconSystemFontawesome,"fetchPromise",null),_defineProperty(IconSystemFontawesome,"cacheKey","core_iconsystem/theme/".concat(Config.theme,"/core/iconmap-fontawesome")),_exports.default})); //# sourceMappingURL=icon_system_fontawesome.min.js.map \ No newline at end of file diff --git a/amd/build/icon_system_fontawesome.min.js.map b/amd/build/icon_system_fontawesome.min.js.map index 76dc7c6..2a1bed1 100644 --- a/amd/build/icon_system_fontawesome.min.js.map +++ b/amd/build/icon_system_fontawesome.min.js.map @@ -1 +1 @@ -{"version":3,"file":"icon_system_fontawesome.min.js","sources":["../src/icon_system_fontawesome.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n//\n// Adaptable theme.\n//\n// An Icon System implementation for FontAwesome based on core/icon_system_fontawesome by\n// Damyon Wiese.\n//\n// @module theme_adaptable/icon_system_fontawesome\n// @copyright 2017 Damyon Wiese\n// @copyright 2023 G J Barnard.\n// @author G J Barnard -\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport {call as fetchMany} from 'core/ajax';\nimport LocalStorage from 'core/localstorage';\nimport IconSystem from 'core/icon_system';\nimport * as Mustache from 'core/mustache';\nimport * as Config from 'core/config';\nimport * as Url from 'core/url';\n\n/**\n * An set of properties for an icon.\n * @typedef {object} IconProperties\n * @property {array} attributes\n * @private\n */\n\n/**\n * The FontAwesome icon system.\n */\nexport default class IconSystemFontawesome extends IconSystem {\n /**\n * @var {Map} staticMap A map of icon names to FA Icon.\n * @private\n */\n static staticMap = null;\n\n /**\n * @var {Promise} fetchPromise The promise used when fetching the result\n * @private\n */\n static fetchPromise = null;\n\n /**\n * @var {string} cacheKey The key used to store the icon map in LocalStorage.\n * @private\n */\n static cacheKey = `core_iconsystem/theme/${Config.theme}/core/iconmap-fontawesome`;\n\n /**\n * Prefetch resources so later calls to renderIcon can be resolved synchronously.\n *\n * @returns {Promise}\n */\n init() {\n if (IconSystemFontawesome.staticMap) {\n return Promise.resolve(this);\n }\n\n if (this.getMapFromCache()) {\n return Promise.resolve(this);\n }\n\n if (IconSystemFontawesome.fetchPromise) {\n return IconSystemFontawesome.fetchPromise;\n }\n\n return this.fetchMapFromServer();\n }\n\n /**\n * Get the icon map from LocalStorage.\n *\n * @private\n * @returns {Map}\n */\n getMapFromCache() {\n const map = LocalStorage.get(IconSystemFontawesome.cacheKey);\n if (map) {\n IconSystemFontawesome.staticMap = new Map(JSON.parse(map));\n }\n return IconSystemFontawesome.staticMap;\n }\n\n /**\n * Fetch the map data from the server.\n *\n * @private\n * @returns {Promise}\n */\n _fetchMapFromServer() {\n return fetchMany([{\n methodname: 'theme_adaptable_output_load_fontawesome_icon_map',\n args: {\n },\n }], true, false, false, 0, Config.themerev)[0];\n }\n\n /**\n * Fetch the map data from the server.\n *\n * @returns {Promise}\n * @private\n */\n async fetchMapFromServer() {\n IconSystemFontawesome.fetchPromise = (async () => {\n const mapData = await this._fetchMapFromServer();\n\n IconSystemFontawesome.staticMap = new Map(Object.entries(mapData).map(([, value]) => ([\n `${value.component}/${value.pix}`,\n value.to,\n ])));\n LocalStorage.set(\n IconSystemFontawesome.cacheKey,\n JSON.stringify(Array.from(IconSystemFontawesome.staticMap.entries())),\n );\n\n return this;\n })();\n\n return IconSystemFontawesome.fetchPromise;\n }\n\n /**\n * Render an icon.\n *\n * @param {string} key\n * @param {string} component\n * @param {string} title\n * @param {string} template\n * @return {string} The rendered HTML content\n */\n renderIcon(key, component, title, template) {\n const iconKey = `${component}/${key}`;\n const mappedIcon = IconSystemFontawesome.staticMap.get(iconKey);\n const unmappedIcon = this.getUnmappedIcon(mappedIcon, key, component, title);\n\n const context = {\n title,\n unmappedIcon,\n alt: title,\n key: mappedIcon,\n };\n\n if (typeof title === \"undefined\" || title === '') {\n context['aria-hidden'] = true;\n }\n\n return Mustache.render(template, context).trim();\n }\n\n /**\n * Get the unmapped icon content, if the icon is not mapped.\n *\n * @param {IconProperties} mappedIcon\n * @param {string} key\n * @param {string} component\n * @param {string} title\n * @returns {IconProperties|null}\n * @private\n */\n getUnmappedIcon(mappedIcon, key, component, title) {\n if (mappedIcon) {\n return null;\n }\n\n return {\n attributes: [\n {name: 'src', value: Url.imageUrl(key, component)},\n {name: 'alt', value: title},\n {name: 'title', value: title}\n ],\n };\n }\n\n /**\n * Get the name of the template to pre-cache for this icon system.\n *\n * @return {string}\n * @method getTemplateName\n */\n getTemplateName() {\n return 'theme_adaptable/pix_icon_fontawesome';\n }\n}\n"],"names":["IconSystemFontawesome","IconSystem","Config","theme","init","staticMap","this","getMapFromCache","Promise","resolve","fetchPromise","fetchMapFromServer","map","LocalStorage","get","cacheKey","Map","JSON","parse","_fetchMapFromServer","methodname","args","themerev","mapData","Object","entries","_ref","value","component","pix","to","set","stringify","Array","from","renderIcon","key","title","template","iconKey","mappedIcon","context","unmappedIcon","getUnmappedIcon","alt","Mustache","render","trim","attributes","name","Url","imageUrl","getTemplateName"],"mappings":";;+SA+CqBA,8BAA8BC,sCAK5B,yBAMG,qBAMH,yBAAwBC,OAAOC,iCAOlDC,cACQJ,sBAAsBK,WAItBC,KAAKC,kBAHEC,QAAQC,QAAQH,MAOvBN,sBAAsBU,aACfV,sBAAsBU,aAG1BJ,KAAKK,qBAShBJ,wBACUK,IAAMC,sBAAaC,IAAId,sBAAsBe,iBAC/CH,MACAZ,sBAAsBK,UAAY,IAAIW,IAAIC,KAAKC,MAAMN,OAElDZ,sBAAsBK,UASjCc,6BACW,cAAU,CAAC,CACdC,WAAY,mDACZC,KAAM,MAEN,GAAM,GAAO,EAAO,EAAGnB,OAAOoB,UAAU,qCAU5CtB,sBAAsBU,aAAe,iBAC3Ba,cAAgBjB,KAAKa,6BAE3BnB,sBAAsBK,UAAY,IAAIW,IAAIQ,OAAOC,QAAQF,SAASX,KAAIc,YAAIC,kBAAY,CACjF,GAAEA,MAAMC,aAAaD,MAAME,MAC5BF,MAAMG,8BAEGC,IACT/B,sBAAsBe,SACtBE,KAAKe,UAAUC,MAAMC,KAAKlC,sBAAsBK,UAAUoB,aAGvDnB,MAZ0B,GAe9BN,sBAAsBU,aAYjCyB,WAAWC,IAAKR,UAAWS,MAAOC,gBACxBC,QAAW,GAAEX,aAAaQ,MAC1BI,WAAaxC,sBAAsBK,UAAUS,IAAIyB,SAGjDE,QAAU,CACZJ,MAAAA,MACAK,aAJiBpC,KAAKqC,gBAAgBH,WAAYJ,IAAKR,UAAWS,OAKlEO,IAAKP,MACLD,IAAKI,wBAGY,IAAVH,OAAmC,KAAVA,QAChCI,QAAQ,gBAAiB,GAGtBI,SAASC,OAAOR,SAAUG,SAASM,OAa9CJ,gBAAgBH,WAAYJ,IAAKR,UAAWS,cACpCG,WACO,KAGJ,CACHQ,WAAY,CACR,CAACC,KAAM,MAAOtB,MAAOuB,IAAIC,SAASf,IAAKR,YACvC,CAACqB,KAAM,MAAOtB,MAAOU,OACrB,CAACY,KAAM,QAAStB,MAAOU,SAWnCe,wBACW"} \ No newline at end of file +{"version":3,"file":"icon_system_fontawesome.min.js","sources":["../src/icon_system_fontawesome.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n//\n// Adaptable theme.\n//\n// An Icon System implementation for FontAwesome based on core/icon_system_fontawesome by\n// Damyon Wiese.\n//\n// @module theme_adaptable/icon_system_fontawesome\n// @copyright 2017 Damyon Wiese\n// @copyright 2023 G J Barnard.\n// @author G J Barnard -\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport {call as fetchMany} from 'core/ajax';\nimport LocalStorage from 'core/localstorage';\nimport IconSystem from 'core/icon_system';\nimport * as Mustache from 'core/mustache';\nimport * as Config from 'core/config';\nimport * as Url from 'core/url';\n\n/**\n * An set of properties for an icon.\n * @typedef {object} IconProperties\n * @property {array} attributes\n * @private\n */\n\n/**\n * The FontAwesome icon system.\n */\nexport default class IconSystemFontawesome extends IconSystem {\n /**\n * @var {Map} staticMap A map of icon names to FA Icon.\n * @private\n */\n static staticMap = null;\n\n /**\n * @var {Promise} fetchPromise The promise used when fetching the result\n * @private\n */\n static fetchPromise = null;\n\n /**\n * @var {string} cacheKey The key used to store the icon map in LocalStorage.\n * @private\n */\n static cacheKey = `core_iconsystem/theme/${Config.theme}/core/iconmap-fontawesome`;\n\n /**\n * Prefetch resources so later calls to renderIcon can be resolved synchronously.\n *\n * @returns {Promise}\n */\n init() {\n if (IconSystemFontawesome.staticMap) {\n return Promise.resolve(this);\n }\n\n if (this.getMapFromCache()) {\n return Promise.resolve(this);\n }\n\n if (IconSystemFontawesome.fetchPromise) {\n return IconSystemFontawesome.fetchPromise;\n }\n\n return this.fetchMapFromServer();\n }\n\n /**\n * Get the icon map from LocalStorage.\n *\n * @private\n * @returns {Map}\n */\n getMapFromCache() {\n const map = LocalStorage.get(IconSystemFontawesome.cacheKey);\n if (map) {\n IconSystemFontawesome.staticMap = new Map(JSON.parse(map));\n }\n return IconSystemFontawesome.staticMap;\n }\n\n /**\n * Fetch the map data from the server.\n *\n * @private\n * @returns {Promise}\n */\n _fetchMapFromServer() {\n return fetchMany([{\n methodname: 'theme_adaptable_output_load_fontawesome_icon_map',\n args: {\n },\n }], true, false, false, 0, Config.themerev)[0];\n }\n\n /**\n * Fetch the map data from the server.\n *\n * @returns {Promise}\n * @private\n */\n async fetchMapFromServer() {\n IconSystemFontawesome.fetchPromise = (async () => {\n const mapData = await this._fetchMapFromServer();\n\n IconSystemFontawesome.staticMap = new Map(Object.entries(mapData).map(([, value]) => ([\n `${value.component}/${value.pix}`,\n value.to,\n ])));\n LocalStorage.set(\n IconSystemFontawesome.cacheKey,\n JSON.stringify(Array.from(IconSystemFontawesome.staticMap.entries())),\n );\n\n return this;\n })();\n\n return IconSystemFontawesome.fetchPromise;\n }\n\n /**\n * Render an icon.\n *\n * @param {string} key\n * @param {string} component\n * @param {string} title\n * @param {string} template\n * @return {string} The rendered HTML content\n */\n renderIcon(key, component, title, template) {\n const iconKey = `${component}/${key}`;\n const mappedIcon = IconSystemFontawesome.staticMap.get(iconKey);\n const unmappedIcon = this.getUnmappedIcon(mappedIcon, key, component, title);\n\n const context = {\n title,\n unmappedIcon,\n alt: title,\n key: mappedIcon,\n };\n\n if (typeof title === \"undefined\" || title === '') {\n context['aria-hidden'] = true;\n }\n\n return Mustache.render(template, context).trim();\n }\n\n /**\n * Get the unmapped icon content, if the icon is not mapped.\n *\n * @param {IconProperties} mappedIcon\n * @param {string} key\n * @param {string} component\n * @param {string} title\n * @returns {IconProperties|null}\n * @private\n */\n getUnmappedIcon(mappedIcon, key, component, title) {\n if (mappedIcon) {\n return null;\n }\n\n return {\n attributes: [\n {name: 'src', value: Url.imageUrl(key, component)},\n {name: 'alt', value: title},\n {name: 'title', value: title}\n ],\n };\n }\n\n /**\n * Get the name of the template to pre-cache for this icon system.\n *\n * @return {string}\n * @method getTemplateName\n */\n getTemplateName() {\n return 'theme_adaptable/pix_icon_fontawesome';\n }\n}\n"],"names":["IconSystemFontawesome","IconSystem","init","staticMap","this","getMapFromCache","Promise","resolve","fetchPromise","fetchMapFromServer","map","LocalStorage","get","cacheKey","Map","JSON","parse","_fetchMapFromServer","methodname","args","Config","themerev","mapData","Object","entries","_ref","value","component","pix","to","set","stringify","Array","from","renderIcon","key","title","template","iconKey","mappedIcon","context","unmappedIcon","getUnmappedIcon","alt","Mustache","render","trim","attributes","name","Url","imageUrl","getTemplateName","theme"],"mappings":"8rDA+CqBA,8BAA8BC,qBAwB/CC,cACQF,sBAAsBG,WAItBC,KAAKC,kBAHEC,QAAQC,QAAQH,MAOvBJ,sBAAsBQ,aACfR,sBAAsBQ,aAG1BJ,KAAKK,qBAShBJ,wBACUK,IAAMC,sBAAaC,IAAIZ,sBAAsBa,iBAC/CH,MACAV,sBAAsBG,UAAY,IAAIW,IAAIC,KAAKC,MAAMN,OAElDV,sBAAsBG,UASjCc,6BACW,cAAU,CAAC,CACdC,WAAY,mDACZC,KAAM,MAEN,GAAM,GAAO,EAAO,EAAGC,OAAOC,UAAU,qCAU5CrB,sBAAsBQ,aAAe,iBAC3Bc,cAAgBlB,KAAKa,6BAE3BjB,sBAAsBG,UAAY,IAAIW,IAAIS,OAAOC,QAAQF,SAASZ,KAAIe,YAAIC,kBAAY,WAC/EA,MAAMC,sBAAaD,MAAME,KAC5BF,MAAMG,8BAEGC,IACT9B,sBAAsBa,SACtBE,KAAKgB,UAAUC,MAAMC,KAAKjC,sBAAsBG,UAAUqB,aAGvDpB,MAZ0B,GAe9BJ,sBAAsBQ,aAYjC0B,WAAWC,IAAKR,UAAWS,MAAOC,gBACxBC,kBAAaX,sBAAaQ,KAC1BI,WAAavC,sBAAsBG,UAAUS,IAAI0B,SAGjDE,QAAU,CACZJ,MAAAA,MACAK,aAJiBrC,KAAKsC,gBAAgBH,WAAYJ,IAAKR,UAAWS,OAKlEO,IAAKP,MACLD,IAAKI,wBAGY,IAAVH,OAAmC,KAAVA,QAChCI,QAAQ,gBAAiB,GAGtBI,SAASC,OAAOR,SAAUG,SAASM,OAa9CJ,gBAAgBH,WAAYJ,IAAKR,UAAWS,cACpCG,WACO,KAGJ,CACHQ,WAAY,CACR,CAACC,KAAM,MAAOtB,MAAOuB,IAAIC,SAASf,IAAKR,YACvC,CAACqB,KAAM,MAAOtB,MAAOU,OACrB,CAACY,KAAM,QAAStB,MAAOU,SAWnCe,wBACW,sGAxJMnD,kCAKE,sBALFA,qCAWK,sBAXLA,iEAiB0BoB,OAAOgC"} \ No newline at end of file diff --git a/amd/build/pace.min.js b/amd/build/pace.min.js index abe8a3f..2dfe777 100644 --- a/amd/build/pace.min.js +++ b/amd/build/pace.min.js @@ -1,3 +1,3 @@ -(function(){var AjaxMonitor,Bar,DocumentMonitor,ElementMonitor,ElementTracker,EventLagMonitor,Evented,Events,NoTargetError,Pace,RequestIntercept,SOURCE_KEYS,Scaler,SocketRequestTracker,XHRRequestTracker,addEventListener,animation,avgAmplitude,bar,cancelAnimation,cancelAnimationFrame,defaultOptions,extend,extendNative,getFromDOM,getIntercept,handlePushState,ignoreStack,init,now,options,requestAnimationFrame,result,runAnimation,scalers,shouldIgnoreURL,shouldTrack,source,sources,uniScaler,_WebSocket,_XDomainRequest,_XMLHttpRequest,_i,_intercept,_len,_pushState,_ref,_replaceState,__slice=[].slice,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);function ctor(){this.constructor=child}return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=33?(last=now(),fn(diff,(function(){return requestAnimationFrame(tick)}))):setTimeout(tick,33-diff)})()},result=function(){var args,key,obj;return obj=arguments[0],key=arguments[1],args=3<=arguments.length?__slice.call(arguments,2):[],"function"==typeof obj[key]?obj[key].apply(obj,args):obj[key]},extend=function(){var key,out,source,sources,val,_i,_len;for(out=arguments[0],_i=0,_len=(sources=2<=arguments.length?__slice.call(arguments,1):[]).length;_i<_len;_i++)if(source=sources[_i])for(key in source)__hasProp.call(source,key)&&(val=source[key],null!=out[key]&&"object"==typeof out[key]&&null!=val&&"object"==typeof val?extend(out[key],val):out[key]=val);return out},avgAmplitude=function(arr){var count,sum,v,_i,_len;for(sum=count=0,_i=0,_len=arr.length;_i<_len;_i++)v=arr[_i],sum+=Math.abs(v),count++;return sum/count},getFromDOM=function(key,json){var data,e,el;if(null==key&&(key="options"),null==json&&(json=!0),el=document.querySelector("[data-pace-"+key+"]")){if(data=el.getAttribute("data-pace-"+key),!json)return data;try{return JSON.parse(data)}catch(_error){return e=_error,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",e):void 0}}},Evented=function(){function Evented(){}return Evented.prototype.on=function(event,handler,ctx,once){var _base;return null==once&&(once=!1),null==this.bindings&&(this.bindings={}),null==(_base=this.bindings)[event]&&(_base[event]=[]),this.bindings[event].push({handler:handler,ctx:ctx,once:once})},Evented.prototype.once=function(event,handler,ctx){return this.on(event,handler,ctx,!0)},Evented.prototype.off=function(event,handler){var i,_ref,_results;if(null!=(null!=(_ref=this.bindings)?_ref[event]:void 0)){if(null==handler)return delete this.bindings[event];for(i=0,_results=[];i\n
\n\n
',null!=targetElement.firstChild?targetElement.insertBefore(this.el,targetElement.firstChild):targetElement.appendChild(this.el)}return this.el},Bar.prototype.finish=function(){var el;return(el=this.getElement()).className=el.className.replace("pace-active","pace-inactive"),document.body.className=document.body.className.replace("pace-running ","pace-done ")},Bar.prototype.update=function(prog){return this.progress=prog,Pace.trigger("progress",prog),this.render()},Bar.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(_error){NoTargetError=_error}return this.el=void 0},Bar.prototype.render=function(){var el,key,progressStr,transform,_j,_len1,_ref2;if(null==document.querySelector(options.target))return!1;for(el=this.getElement(),transform="translate3d("+this.progress+"%, 0, 0)",_j=0,_len1=(_ref2=["webkitTransform","msTransform","transform"]).length;_j<_len1;_j++)key=_ref2[_j],el.children[0].style[key]=transform;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(el.children[0].setAttribute("data-progress-text",(0|this.progress)+"%"),this.progress>=100?progressStr="99":(progressStr=this.progress<10?"0":"",progressStr+=0|this.progress),el.children[0].setAttribute("data-progress",""+progressStr)),Pace.trigger("change",this.progress),this.lastRenderedProgress=this.progress},Bar.prototype.done=function(){return this.progress>=100},Bar}(),Events=function(){function Events(){this.bindings={}}return Events.prototype.trigger=function(name,val){var binding,_j,_len1,_ref2,_results;if(null!=this.bindings[name]){for(_results=[],_j=0,_len1=(_ref2=this.bindings[name]).length;_j<_len1;_j++)binding=_ref2[_j],_results.push(binding.call(this,val));return _results}},Events.prototype.on=function(name,fn){var _base;return null==(_base=this.bindings)[name]&&(_base[name]=[]),this.bindings[name].push(fn)},Events}(),_XMLHttpRequest=window.XMLHttpRequest,_XDomainRequest=window.XDomainRequest,_WebSocket=window.WebSocket,extendNative=function(to,from){var key,_results;for(key in _results=[],from.prototype)try{null==to[key]&&"function"!=typeof from[key]?"function"==typeof Object.defineProperty?_results.push(Object.defineProperty(to,key,{get:function(key){return function(){return from.prototype[key]}}(key),configurable:!0,enumerable:!0})):_results.push(to[key]=from.prototype[key]):_results.push(void 0)}catch(_error){_error}return _results},ignoreStack=[],Pace.ignore=function(){var args,fn,ret;return fn=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ignoreStack.unshift("ignore"),ret=fn.apply(null,args),ignoreStack.shift(),ret},Pace.track=function(){var args,fn,ret;return fn=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ignoreStack.unshift("track"),ret=fn.apply(null,args),ignoreStack.shift(),ret},shouldTrack=function(method){var _ref2;if(null==method&&(method="GET"),"track"===ignoreStack[0])return"force";if(!ignoreStack.length&&options.ajax){if("socket"===method&&options.ajax.trackWebSockets)return!0;if(_ref2=method.toUpperCase(),__indexOf.call(options.ajax.trackMethods,_ref2)>=0)return!0}return!1},RequestIntercept=function(_super){function RequestIntercept(){var monitorXHR,_this=this;RequestIntercept.__super__.constructor.apply(this,arguments),monitorXHR=function(req){var _open;return _open=req.open,req.open=function(type,url,async){return shouldTrack(type)&&_this.trigger("request",{type:type,url:url,request:req}),_open.apply(req,arguments)}},window.XMLHttpRequest=function(flags){var req;return req=new _XMLHttpRequest(flags),monitorXHR(req),req};try{extendNative(window.XMLHttpRequest,_XMLHttpRequest)}catch(_error){}if(null!=_XDomainRequest){window.XDomainRequest=function(){var req;return req=new _XDomainRequest,monitorXHR(req),req};try{extendNative(window.XDomainRequest,_XDomainRequest)}catch(_error){}}if(null!=_WebSocket&&options.ajax.trackWebSockets){window.WebSocket=function(url,protocols){var req;return req=null!=protocols?new _WebSocket(url,protocols):new _WebSocket(url),shouldTrack("socket")&&_this.trigger("request",{type:"socket",url:url,protocols:protocols,request:req}),req};try{extendNative(window.WebSocket,_WebSocket)}catch(_error){}}}return __extends(RequestIntercept,_super),RequestIntercept}(Events),_intercept=null,shouldIgnoreURL=function(url){var pattern,_j,_len1,_ref2;for(_j=0,_len1=(_ref2=options.ajax.ignoreURLs).length;_j<_len1;_j++)if("string"==typeof(pattern=_ref2[_j])){if(-1!==url.indexOf(pattern))return!0}else if(pattern.test(url))return!0;return!1},(getIntercept=function(){return null==_intercept&&(_intercept=new RequestIntercept),_intercept})().on("request",(function(_arg){var after,args,request,type,url;if(type=_arg.type,request=_arg.request,url=_arg.url,!shouldIgnoreURL(url))return Pace.running||!1===options.restartOnRequestAfter&&"force"!==shouldTrack(type)?void 0:(args=arguments,"boolean"==typeof(after=options.restartOnRequestAfter||0)&&(after=0),setTimeout((function(){var _j,_len1,_ref2,_ref3,_results;if("socket"===type?request.readyState<1:0<(_ref2=request.readyState)&&_ref2<4){for(Pace.restart(),_results=[],_j=0,_len1=(_ref3=Pace.sources).length;_j<_len1;_j++){if((source=_ref3[_j])instanceof AjaxMonitor){source.watch.apply(source,args);break}_results.push(void 0)}return _results}}),after))})),AjaxMonitor=function(){function AjaxMonitor(){this.complete=__bind(this.complete,this);var _this=this;this.elements=[],getIntercept().on("request",(function(){return _this.watch.apply(_this,arguments)}))}return AjaxMonitor.prototype.watch=function(_arg){var request,tracker,type,url;if(type=_arg.type,request=_arg.request,url=_arg.url,!shouldIgnoreURL(url))return tracker="socket"===type?new SocketRequestTracker(request,this.complete):new XHRRequestTracker(request,this.complete),this.elements.push(tracker)},AjaxMonitor.prototype.complete=function(tracker){return this.elements=this.elements.filter((function(e){return e!==tracker}))},AjaxMonitor}(),XHRRequestTracker=function(request,completeCallback){var _j,_len1,_onreadystatechange,_ref2,_this=this;if(this.progress=0,null!=window.ProgressEvent)for(addEventListener(request,"progress",(function(evt){return evt.lengthComputable?_this.progress=100*evt.loaded/evt.total:_this.progress=_this.progress+(100-_this.progress)/2})),_j=0,_len1=(_ref2=["load","abort","timeout","error"]).length;_j<_len1;_j++)addEventListener(request,_ref2[_j],(function(){return completeCallback(_this),_this.progress=100}));else _onreadystatechange=request.onreadystatechange,request.onreadystatechange=function(){var _ref3;return 0===(_ref3=request.readyState)||4===_ref3?(completeCallback(_this),_this.progress=100):3===request.readyState&&(_this.progress=50),"function"==typeof _onreadystatechange?_onreadystatechange.apply(null,arguments):void 0}},SocketRequestTracker=function(request,completeCallback){var _j,_len1,_ref2,_this=this;for(this.progress=0,_j=0,_len1=(_ref2=["error","open"]).length;_j<_len1;_j++)addEventListener(request,_ref2[_j],(function(){return completeCallback(_this),_this.progress=100}))},ElementMonitor=function(){function ElementMonitor(options){var selector,_j,_len1,_ref2;for(null==options&&(options={}),this.complete=__bind(this.complete,this),this.elements=[],null==options.selectors&&(options.selectors=[]),_j=0,_len1=(_ref2=options.selectors).length;_j<_len1;_j++)selector=_ref2[_j],this.elements.push(new ElementTracker(selector,this.complete))}return ElementMonitor.prototype.complete=function(tracker){return this.elements=this.elements.filter((function(e){return e!==tracker}))},ElementMonitor}(),ElementTracker=function(){function ElementTracker(selector,completeCallback){this.selector=selector,this.completeCallback=completeCallback,this.progress=0,this.check()}return ElementTracker.prototype.check=function(){var _this=this;return document.querySelector(this.selector)?this.done():setTimeout((function(){return _this.check()}),options.elements.checkInterval)},ElementTracker.prototype.done=function(){return this.completeCallback(this),this.completeCallback=null,this.progress=100},ElementTracker}(),DocumentMonitor=function(){function DocumentMonitor(){var _onreadystatechange,_ref2,_this=this;this.progress=null!=(_ref2=this.states[document.readyState])?_ref2:100,_onreadystatechange=document.onreadystatechange,document.onreadystatechange=function(){return null!=_this.states[document.readyState]&&(_this.progress=_this.states[document.readyState]),"function"==typeof _onreadystatechange?_onreadystatechange.apply(null,arguments):void 0}}return DocumentMonitor.prototype.states={loading:0,interactive:50,complete:100},DocumentMonitor}(),EventLagMonitor=function(){var avg,interval,last,points,samples,_this=this;this.progress=0,avg=0,samples=[],points=0,last=now(),interval=setInterval((function(){var diff;return diff=now()-last-50,last=now(),samples.push(diff),samples.length>options.eventLag.sampleCount&&samples.shift(),avg=avgAmplitude(samples),++points>=options.eventLag.minSamples&&avg=100&&(this.done=!0),val===this.last?this.sinceLastUpdate+=frameTime:(this.sinceLastUpdate&&(this.rate=(val-this.last)/this.sinceLastUpdate),this.catchup=(val-this.progress)/options.catchupTime,this.sinceLastUpdate=0,this.last=val),val>this.progress&&(this.progress+=this.catchup*frameTime),scaling=1-Math.pow(this.progress/100,options.easeFactor),this.progress+=scaling*this.rate*frameTime,this.progress=Math.min(this.lastProgress+options.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},Scaler}(),sources=null,scalers=null,bar=null,uniScaler=null,animation=null,cancelAnimation=null,Pace.running=!1,handlePushState=function(){if(options.restartOnPushState)return Pace.restart()},null!=window.history.pushState&&(_pushState=window.history.pushState,window.history.pushState=function(){return handlePushState(),_pushState.apply(window.history,arguments)}),null!=window.history.replaceState&&(_replaceState=window.history.replaceState,window.history.replaceState=function(){return handlePushState(),_replaceState.apply(window.history,arguments)}),SOURCE_KEYS={ajax:AjaxMonitor,elements:ElementMonitor,document:DocumentMonitor,eventLag:EventLagMonitor},(init=function(){var type,_j,_k,_len1,_len2,_ref2,_ref3,_ref4;for(Pace.sources=sources=[],_j=0,_len1=(_ref2=["ajax","elements","document","eventLag"]).length;_j<_len1;_j++)!1!==options[type=_ref2[_j]]&&sources.push(new SOURCE_KEYS[type](options[type]));for(_k=0,_len2=(_ref4=null!=(_ref3=options.extraSources)?_ref3:[]).length;_k<_len2;_k++)source=_ref4[_k],sources.push(new source(options));return Pace.bar=bar=new Bar,scalers=[],uniScaler=new Scaler})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,bar.destroy(),cancelAnimation=!0,null!=animation&&("function"==typeof cancelAnimationFrame&&cancelAnimationFrame(animation),animation=null),init()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){var start;return Pace.running=!0,bar.render(),start=now(),cancelAnimation=!1,animation=runAnimation((function(frameTime,enqueueNextFrame){var avg,count,done,element,elements,i,j,scaler,scalerList,sum,_j,_k,_len1,_len2,_ref2;for(100-bar.progress,count=sum=0,done=!0,i=_j=0,_len1=sources.length;_j<_len1;i=++_j)for(source=sources[i],scalerList=null!=scalers[i]?scalers[i]:scalers[i]=[],j=_k=0,_len2=(elements=null!=(_ref2=source.elements)?_ref2:[source]).length;_k<_len2;j=++_k)element=elements[j],done&=(scaler=null!=scalerList[j]?scalerList[j]:scalerList[j]=new Scaler(element)).done,scaler.done||(count++,sum+=scaler.tick(frameTime));return avg=sum/count,bar.update(uniScaler.tick(frameTime,avg)),bar.done()||done||cancelAnimation?(bar.update(100),Pace.trigger("done"),setTimeout((function(){return bar.finish(),Pace.running=!1,Pace.trigger("hide")}),Math.max(options.ghostTime,Math.max(options.minTime-(now()-start),0)))):enqueueNextFrame()}))},Pace.start=function(_options){extend(options,_options),Pace.running=!0;try{bar.render()}catch(_error){NoTargetError=_error}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},"function"==typeof define&&define.amd?define("theme_adaptable/pace",(function(){return Pace})):"object"==typeof exports?module.exports=Pace:options.startOnPageLoad&&Pace.start()}).call(window); +(function(){var AjaxMonitor,Bar,DocumentMonitor,ElementMonitor,ElementTracker,EventLagMonitor,Evented,Events,NoTargetError,Pace,RequestIntercept,SOURCE_KEYS,Scaler,SocketRequestTracker,XHRRequestTracker,addEventListener,animation,avgAmplitude,bar,cancelAnimation,cancelAnimationFrame,defaultOptions,extend,extendNative,getFromDOM,getIntercept,handlePushState,ignoreStack,init,now,options,requestAnimationFrame,result,runAnimation,scalers,shouldIgnoreURL,shouldTrack,source,sources,uniScaler,_WebSocket,_XDomainRequest,_XMLHttpRequest,_i,_intercept,_len,_pushState,_ref,_replaceState,__slice=[].slice,__hasProp={}.hasOwnProperty,__extends=function(child,parent){for(var key in parent)__hasProp.call(parent,key)&&(child[key]=parent[key]);function ctor(){this.constructor=child}return ctor.prototype=parent.prototype,child.prototype=new ctor,child.__super__=parent.prototype,child},__indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i=33?(last=now(),fn(diff,(function(){return requestAnimationFrame(tick)}))):setTimeout(tick,33-diff)})()},result=function(){var args,key,obj;return obj=arguments[0],key=arguments[1],args=3<=arguments.length?__slice.call(arguments,2):[],"function"==typeof obj[key]?obj[key].apply(obj,args):obj[key]},extend=function(){var key,out,source,sources,val,_i,_len;for(out=arguments[0],_i=0,_len=(sources=2<=arguments.length?__slice.call(arguments,1):[]).length;_i<_len;_i++)if(source=sources[_i])for(key in source)__hasProp.call(source,key)&&(val=source[key],null!=out[key]&&"object"==typeof out[key]&&null!=val&&"object"==typeof val?extend(out[key],val):out[key]=val);return out},avgAmplitude=function(arr){var count,sum,v,_i,_len;for(sum=count=0,_i=0,_len=arr.length;_i<_len;_i++)v=arr[_i],sum+=Math.abs(v),count++;return sum/count},getFromDOM=function(key,json){var data,e,el;if(null==key&&(key="options"),null==json&&(json=!0),el=document.querySelector("[data-pace-"+key+"]")){if(data=el.getAttribute("data-pace-"+key),!json)return data;try{return JSON.parse(data)}catch(_error){return e=_error,"undefined"!=typeof console&&null!==console?console.error("Error parsing inline pace options",e):void 0}}},Evented=function(){function Evented(){}return Evented.prototype.on=function(event,handler,ctx,once){var _base;return null==once&&(once=!1),null==this.bindings&&(this.bindings={}),null==(_base=this.bindings)[event]&&(_base[event]=[]),this.bindings[event].push({handler:handler,ctx:ctx,once:once})},Evented.prototype.once=function(event,handler,ctx){return this.on(event,handler,ctx,!0)},Evented.prototype.off=function(event,handler){var i,_ref,_results;if(null!=(null!=(_ref=this.bindings)?_ref[event]:void 0)){if(null==handler)return delete this.bindings[event];for(i=0,_results=[];i\n
\n\n
',null!=targetElement.firstChild?targetElement.insertBefore(this.el,targetElement.firstChild):targetElement.appendChild(this.el)}return this.el},Bar.prototype.finish=function(){var el;return(el=this.getElement()).className=el.className.replace("pace-active","pace-inactive"),document.body.className=document.body.className.replace("pace-running ","pace-done ")},Bar.prototype.update=function(prog){return this.progress=prog,Pace.trigger("progress",prog),this.render()},Bar.prototype.destroy=function(){try{this.getElement().parentNode.removeChild(this.getElement())}catch(_error){NoTargetError=_error}return this.el=void 0},Bar.prototype.render=function(){var el,key,progressStr,transform,_j,_len1,_ref2;if(null==document.querySelector(options.target))return!1;for(el=this.getElement(),transform="translate3d("+this.progress+"%, 0, 0)",_j=0,_len1=(_ref2=["webkitTransform","msTransform","transform"]).length;_j<_len1;_j++)key=_ref2[_j],el.children[0].style[key]=transform;return(!this.lastRenderedProgress||this.lastRenderedProgress|0!==this.progress|0)&&(el.children[0].setAttribute("data-progress-text",(0|this.progress)+"%"),this.progress>=100?progressStr="99":(progressStr=this.progress<10?"0":"",progressStr+=0|this.progress),el.children[0].setAttribute("data-progress",""+progressStr)),Pace.trigger("change",this.progress),this.lastRenderedProgress=this.progress},Bar.prototype.done=function(){return this.progress>=99},Bar}(),Events=function(){function Events(){this.bindings={}}return Events.prototype.trigger=function(name,val){var binding,_j,_len1,_ref2,_results;if(null!=this.bindings[name]){for(_results=[],_j=0,_len1=(_ref2=this.bindings[name]).length;_j<_len1;_j++)binding=_ref2[_j],_results.push(binding.call(this,val));return _results}},Events.prototype.on=function(name,fn){var _base;return null==(_base=this.bindings)[name]&&(_base[name]=[]),this.bindings[name].push(fn)},Events}(),_XMLHttpRequest=window.XMLHttpRequest,_XDomainRequest=window.XDomainRequest,_WebSocket=window.WebSocket,extendNative=function(to,from){var key,_results;for(key in _results=[],from.prototype)try{null==to[key]&&"function"!=typeof from[key]?"function"==typeof Object.defineProperty?_results.push(Object.defineProperty(to,key,{get:function(key){return function(){return from.prototype[key]}}(key),configurable:!0,enumerable:!0})):_results.push(to[key]=from.prototype[key]):_results.push(void 0)}catch(_error){_error}return _results},ignoreStack=[],Pace.ignore=function(){var args,fn,ret;return fn=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ignoreStack.unshift("ignore"),ret=fn.apply(null,args),ignoreStack.shift(),ret},Pace.track=function(){var args,fn,ret;return fn=arguments[0],args=2<=arguments.length?__slice.call(arguments,1):[],ignoreStack.unshift("track"),ret=fn.apply(null,args),ignoreStack.shift(),ret},shouldTrack=function(method){var _ref2;if(null==method&&(method="GET"),"track"===ignoreStack[0])return"force";if(!ignoreStack.length&&options.ajax){if("socket"===method&&options.ajax.trackWebSockets)return!0;if(_ref2=method.toUpperCase(),__indexOf.call(options.ajax.trackMethods,_ref2)>=0)return!0}return!1},RequestIntercept=function(_super){function RequestIntercept(){var monitorXHR,_this=this;RequestIntercept.__super__.constructor.apply(this,arguments),monitorXHR=function(req){var _open;return _open=req.open,req.open=function(type,url,async){return shouldTrack(type)&&_this.trigger("request",{type:type,url:url,request:req}),_open.apply(req,arguments)}},window.XMLHttpRequest=function(flags){var req;return req=new _XMLHttpRequest(flags),monitorXHR(req),req};try{extendNative(window.XMLHttpRequest,_XMLHttpRequest)}catch(_error){}if(null!=_XDomainRequest){window.XDomainRequest=function(){var req;return req=new _XDomainRequest,monitorXHR(req),req};try{extendNative(window.XDomainRequest,_XDomainRequest)}catch(_error){}}if(null!=_WebSocket&&options.ajax.trackWebSockets){window.WebSocket=function(url,protocols){var req;return req=null!=protocols?new _WebSocket(url,protocols):new _WebSocket(url),shouldTrack("socket")&&_this.trigger("request",{type:"socket",url:url,protocols:protocols,request:req}),req};try{extendNative(window.WebSocket,_WebSocket)}catch(_error){}}}return __extends(RequestIntercept,_super),RequestIntercept}(Events),_intercept=null,shouldIgnoreURL=function(url){var pattern,_j,_len1,_ref2;for(_j=0,_len1=(_ref2=options.ajax.ignoreURLs).length;_j<_len1;_j++)if("string"==typeof(pattern=_ref2[_j])){if(-1!==url.indexOf(pattern))return!0}else if(pattern.test(url))return!0;return!1},(getIntercept=function(){return null==_intercept&&(_intercept=new RequestIntercept),_intercept})().on("request",(function(_arg){var after,args,request,type,url;if(type=_arg.type,request=_arg.request,url=_arg.url,!shouldIgnoreURL(url))return Pace.running||!1===options.restartOnRequestAfter&&"force"!==shouldTrack(type)?void 0:(args=arguments,"boolean"==typeof(after=options.restartOnRequestAfter||0)&&(after=0),setTimeout((function(){var _j,_len1,_ref2,_ref3,_results;if("socket"===type?request.readyState<1:0<(_ref2=request.readyState)&&_ref2<4){for(Pace.restart(),_results=[],_j=0,_len1=(_ref3=Pace.sources).length;_j<_len1;_j++){if((source=_ref3[_j])instanceof AjaxMonitor){source.watch.apply(source,args);break}_results.push(void 0)}return _results}}),after))})),AjaxMonitor=function(){function AjaxMonitor(){this.complete=__bind(this.complete,this);var _this=this;this.elements=[],getIntercept().on("request",(function(){return _this.watch.apply(_this,arguments)}))}return AjaxMonitor.prototype.watch=function(_arg){var request,tracker,type,url;if(type=_arg.type,request=_arg.request,url=_arg.url,!shouldIgnoreURL(url))return tracker="socket"===type?new SocketRequestTracker(request,this.complete):new XHRRequestTracker(request,this.complete),this.elements.push(tracker)},AjaxMonitor.prototype.complete=function(tracker){return this.elements=this.elements.filter((function(e){return e!==tracker}))},AjaxMonitor}(),XHRRequestTracker=function(request,completeCallback){var _j,_len1,_onreadystatechange,_ref2,_this=this;if(this.progress=0,null!=window.ProgressEvent)for(addEventListener(request,"progress",(function(evt){return evt.lengthComputable?_this.progress=100*evt.loaded/evt.total:_this.progress=_this.progress+(100-_this.progress)/2})),_j=0,_len1=(_ref2=["load","abort","timeout","error"]).length;_j<_len1;_j++)addEventListener(request,_ref2[_j],(function(){return completeCallback(_this),_this.progress=100}));else _onreadystatechange=request.onreadystatechange,request.onreadystatechange=function(){var _ref3;return 0===(_ref3=request.readyState)||4===_ref3?(completeCallback(_this),_this.progress=100):3===request.readyState&&(_this.progress=50),"function"==typeof _onreadystatechange?_onreadystatechange.apply(null,arguments):void 0}},SocketRequestTracker=function(request,completeCallback){var _j,_len1,_ref2,_this=this;for(this.progress=0,_j=0,_len1=(_ref2=["error","open"]).length;_j<_len1;_j++)addEventListener(request,_ref2[_j],(function(){return completeCallback(_this),_this.progress=100}))},ElementMonitor=function(){function ElementMonitor(options){var selector,_j,_len1,_ref2;for(null==options&&(options={}),this.complete=__bind(this.complete,this),this.elements=[],null==options.selectors&&(options.selectors=[]),_j=0,_len1=(_ref2=options.selectors).length;_j<_len1;_j++)selector=_ref2[_j],this.elements.push(new ElementTracker(selector,this.complete))}return ElementMonitor.prototype.complete=function(tracker){return this.elements=this.elements.filter((function(e){return e!==tracker}))},ElementMonitor}(),ElementTracker=function(){function ElementTracker(selector,completeCallback){this.selector=selector,this.completeCallback=completeCallback,this.progress=0,this.check()}return ElementTracker.prototype.check=function(){var _this=this;return document.querySelector(this.selector)?this.done():setTimeout((function(){return _this.check()}),options.elements.checkInterval)},ElementTracker.prototype.done=function(){return this.completeCallback(this),this.completeCallback=null,this.progress=100},ElementTracker}(),DocumentMonitor=function(){function DocumentMonitor(){var _onreadystatechange,_ref2,_this=this;this.progress=null!=(_ref2=this.states[document.readyState])?_ref2:100,_onreadystatechange=document.onreadystatechange,document.onreadystatechange=function(){return null!=_this.states[document.readyState]&&(_this.progress=_this.states[document.readyState]),"function"==typeof _onreadystatechange?_onreadystatechange.apply(null,arguments):void 0}}return DocumentMonitor.prototype.states={loading:0,interactive:50,complete:100},DocumentMonitor}(),EventLagMonitor=function(){var avg,interval,last,points,samples,_this=this;this.progress=0,avg=0,samples=[],points=0,last=now(),interval=setInterval((function(){var diff;return diff=now()-last-50,last=now(),samples.push(diff),samples.length>options.eventLag.sampleCount&&samples.shift(),avg=avgAmplitude(samples),++points>=options.eventLag.minSamples&&avg=100&&(this.done=!0),val===this.last?this.sinceLastUpdate+=frameTime:(this.sinceLastUpdate&&(this.rate=(val-this.last)/this.sinceLastUpdate),this.catchup=(val-this.progress)/options.catchupTime,this.sinceLastUpdate=0,this.last=val),val>this.progress&&(this.progress+=this.catchup*frameTime),scaling=1-Math.pow(this.progress/100,options.easeFactor),this.progress+=scaling*this.rate*frameTime,this.progress=Math.min(this.lastProgress+options.maxProgressPerFrame,this.progress),this.progress=Math.max(0,this.progress),this.progress=Math.min(100,this.progress),this.lastProgress=this.progress,this.progress},Scaler}(),sources=null,scalers=null,bar=null,uniScaler=null,animation=null,cancelAnimation=null,Pace.running=!1,handlePushState=function(){if(options.restartOnPushState)return Pace.restart()},null!=window.history.pushState&&(_pushState=window.history.pushState,window.history.pushState=function(){return handlePushState(),_pushState.apply(window.history,arguments)}),null!=window.history.replaceState&&(_replaceState=window.history.replaceState,window.history.replaceState=function(){return handlePushState(),_replaceState.apply(window.history,arguments)}),SOURCE_KEYS={ajax:AjaxMonitor,elements:ElementMonitor,document:DocumentMonitor,eventLag:EventLagMonitor},(init=function(){var type,_j,_k,_len1,_len2,_ref2,_ref3,_ref4;for(Pace.sources=sources=[],_j=0,_len1=(_ref2=["ajax","elements","document","eventLag"]).length;_j<_len1;_j++)!1!==options[type=_ref2[_j]]&&sources.push(new SOURCE_KEYS[type](options[type]));for(_k=0,_len2=(_ref4=null!=(_ref3=options.extraSources)?_ref3:[]).length;_k<_len2;_k++)source=_ref4[_k],sources.push(new source(options));return Pace.bar=bar=new Bar,scalers=[],uniScaler=new Scaler})(),Pace.stop=function(){return Pace.trigger("stop"),Pace.running=!1,bar.destroy(),cancelAnimation=!0,null!=animation&&("function"==typeof cancelAnimationFrame&&cancelAnimationFrame(animation),animation=null),init()},Pace.restart=function(){return Pace.trigger("restart"),Pace.stop(),Pace.start()},Pace.go=function(){var start;return Pace.running=!0,bar.render(),start=now(),cancelAnimation=!1,animation=runAnimation((function(frameTime,enqueueNextFrame){var avg,count,done,element,elements,i,j,scaler,scalerList,sum,_j,_k,_len1,_len2,_ref2;for(100-bar.progress,count=sum=0,done=!0,i=_j=0,_len1=sources.length;_j<_len1;i=++_j)for(source=sources[i],scalerList=null!=scalers[i]?scalers[i]:scalers[i]=[],j=_k=0,_len2=(elements=null!=(_ref2=source.elements)?_ref2:[source]).length;_k<_len2;j=++_k)element=elements[j],done&=(scaler=null!=scalerList[j]?scalerList[j]:scalerList[j]=new Scaler(element)).done,scaler.done||(count++,sum+=scaler.tick(frameTime));return avg=sum/count,bar.update(uniScaler.tick(frameTime,avg)),bar.done()||done||cancelAnimation?(bar.update(100),Pace.trigger("done"),setTimeout((function(){return bar.finish(),Pace.running=!1,Pace.trigger("hide")}),Math.max(options.ghostTime,Math.max(options.minTime-(now()-start),0)))):enqueueNextFrame()}))},Pace.start=function(_options){extend(options,_options),Pace.running=!0;try{bar.render()}catch(_error){NoTargetError=_error}return document.querySelector(".pace")?(Pace.trigger("start"),Pace.go()):setTimeout(Pace.start,50)},"function"==typeof define&&define.amd?define("theme_adaptable/pace",(function(){return Pace})):"object"==typeof exports?module.exports=Pace:options.startOnPageLoad&&Pace.start()}).call(window); //# sourceMappingURL=pace.min.js.map \ No newline at end of file diff --git a/amd/build/pace.min.js.map b/amd/build/pace.min.js.map index ecb3366..dc60b36 100644 --- a/amd/build/pace.min.js.map +++ b/amd/build/pace.min.js.map @@ -1 +1 @@ -{"version":3,"file":"pace.min.js","sources":["../src/pace.js"],"sourcesContent":["/*!\n * pace.js v1.2.4\n * https://github.com/CodeByZach/pace/\n * Licensed MIT © HubSpot, Inc.\n */\n(function() {\n var AjaxMonitor, Bar, DocumentMonitor, ElementMonitor, ElementTracker, EventLagMonitor, Evented, Events, NoTargetError, Pace, RequestIntercept, SOURCE_KEYS, Scaler, SocketRequestTracker, XHRRequestTracker, addEventListener, animation, avgAmplitude, bar, cancelAnimation, cancelAnimationFrame, defaultOptions, extend, extendNative, getFromDOM, getIntercept, handlePushState, ignoreStack, init, now, options, requestAnimationFrame, result, runAnimation, scalers, shouldIgnoreURL, shouldTrack, source, sources, uniScaler, _WebSocket, _XDomainRequest, _XMLHttpRequest, _i, _intercept, _len, _pushState, _ref, _ref1, _replaceState,\n __slice = [].slice,\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n defaultOptions = {\n className: '',\n catchupTime: 100,\n initialRate: .03,\n minTime: 250,\n ghostTime: 100,\n maxProgressPerFrame: 20,\n easeFactor: 1.25,\n startOnPageLoad: true,\n restartOnPushState: true,\n restartOnRequestAfter: 500,\n target: 'body',\n elements: {\n checkInterval: 100,\n selectors: ['body']\n },\n eventLag: {\n minSamples: 10,\n sampleCount: 3,\n lagThreshold: 3\n },\n ajax: {\n trackMethods: ['GET'],\n trackWebSockets: true,\n ignoreURLs: []\n }\n };\n\n now = function() {\n var _ref;\n return (_ref = typeof performance !== \"undefined\" && performance !== null ? typeof performance.now === \"function\" ? performance.now() : void 0 : void 0) != null ? _ref : +(new Date);\n };\n\n requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;\n\n cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame;\n\n addEventListener = function(obj, event, callback) {\n if (typeof obj.addEventListener === \"function\") {\n return obj.addEventListener(event, callback, false);\n } else {\n return function() {\n if (typeof obj[\"on\" + event] !== \"function\" || typeof obj[\"on\" + event].eventListeners !== \"object\") {\n var eventListeners = new Events();\n if (typeof obj[\"on\" + event] === \"function\") {\n eventListeners.on(event, obj[\"on\" + event]);\n }\n obj[\"on\" + event] = function(evt) {\n return eventListeners.trigger(event, evt);\n };\n obj[\"on\" + event].eventListeners = eventListeners;\n } else {\n var eventListeners = obj[\"on\" + event].eventListeners;\n }\n eventListeners.on(event, callback);\n }();\n }\n };\n\n if (requestAnimationFrame == null) {\n requestAnimationFrame = function(fn) {\n return setTimeout(fn, 50);\n };\n cancelAnimationFrame = function(id) {\n return clearTimeout(id);\n };\n }\n\n runAnimation = function(fn) {\n var last, tick;\n last = now();\n tick = function() {\n var diff;\n diff = now() - last;\n if (diff >= 33) {\n last = now();\n return fn(diff, function() {\n return requestAnimationFrame(tick);\n });\n } else {\n return setTimeout(tick, 33 - diff);\n }\n };\n return tick();\n };\n\n result = function() {\n var args, key, obj;\n obj = arguments[0], key = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];\n if (typeof obj[key] === 'function') {\n return obj[key].apply(obj, args);\n } else {\n return obj[key];\n }\n };\n\n extend = function() {\n var key, out, source, sources, val, _i, _len;\n out = arguments[0], sources = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n for (_i = 0, _len = sources.length; _i < _len; _i++) {\n source = sources[_i];\n if (source) {\n for (key in source) {\n if (!__hasProp.call(source, key)) continue;\n val = source[key];\n if ((out[key] != null) && typeof out[key] === 'object' && (val != null) && typeof val === 'object') {\n extend(out[key], val);\n } else {\n out[key] = val;\n }\n }\n }\n }\n return out;\n };\n\n avgAmplitude = function(arr) {\n var count, sum, v, _i, _len;\n sum = count = 0;\n for (_i = 0, _len = arr.length; _i < _len; _i++) {\n v = arr[_i];\n sum += Math.abs(v);\n count++;\n }\n return sum / count;\n };\n\n getFromDOM = function(key, json) {\n var data, e, el;\n if (key == null) {\n key = 'options';\n }\n if (json == null) {\n json = true;\n }\n el = document.querySelector(\"[data-pace-\" + key + \"]\");\n if (!el) {\n return;\n }\n data = el.getAttribute(\"data-pace-\" + key);\n if (!json) {\n return data;\n }\n try {\n return JSON.parse(data);\n } catch (_error) {\n e = _error;\n return typeof console !== \"undefined\" && console !== null ? console.error(\"Error parsing inline pace options\", e) : void 0;\n }\n };\n\n Evented = (function() {\n function Evented() {}\n\n Evented.prototype.on = function(event, handler, ctx, once) {\n var _base;\n if (once == null) {\n once = false;\n }\n if (this.bindings == null) {\n this.bindings = {};\n }\n if ((_base = this.bindings)[event] == null) {\n _base[event] = [];\n }\n return this.bindings[event].push({\n handler: handler,\n ctx: ctx,\n once: once\n });\n };\n\n Evented.prototype.once = function(event, handler, ctx) {\n return this.on(event, handler, ctx, true);\n };\n\n Evented.prototype.off = function(event, handler) {\n var i, _ref, _results;\n if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {\n return;\n }\n if (handler == null) {\n return delete this.bindings[event];\n } else {\n i = 0;\n _results = [];\n while (i < this.bindings[event].length) {\n if (this.bindings[event][i].handler === handler) {\n _results.push(this.bindings[event].splice(i, 1));\n } else {\n _results.push(i++);\n }\n }\n return _results;\n }\n };\n\n Evented.prototype.trigger = function() {\n var args, ctx, event, handler, i, once, _ref, _ref1, _results;\n event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n if ((_ref = this.bindings) != null ? _ref[event] : void 0) {\n i = 0;\n _results = [];\n while (i < this.bindings[event].length) {\n _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;\n handler.apply(ctx != null ? ctx : this, args);\n if (once) {\n _results.push(this.bindings[event].splice(i, 1));\n } else {\n _results.push(i++);\n }\n }\n return _results;\n }\n };\n\n return Evented;\n\n })();\n\n Pace = window.Pace || {};\n\n window.Pace = Pace;\n\n extend(Pace, Evented.prototype);\n\n options = Pace.options = extend({}, defaultOptions, window.paceOptions, getFromDOM());\n\n _ref = ['ajax', 'document', 'eventLag', 'elements'];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n source = _ref[_i];\n if (options[source] === true) {\n options[source] = defaultOptions[source];\n }\n }\n\n NoTargetError = (function(_super) {\n __extends(NoTargetError, _super);\n\n function NoTargetError() {\n _ref1 = NoTargetError.__super__.constructor.apply(this, arguments);\n return _ref1;\n }\n\n return NoTargetError;\n\n })(Error);\n\n Bar = (function() {\n function Bar() {\n this.progress = 0;\n }\n\n Bar.prototype.getElement = function() {\n var targetElement;\n if (this.el == null) {\n targetElement = document.querySelector(options.target);\n if (!targetElement) {\n throw new NoTargetError;\n }\n this.el = document.createElement('div');\n this.el.className = \"pace pace-active\";\n document.body.className = document.body.className.replace(/(pace-done )|/, 'pace-running ');\n var _custom_class_name = (options.className !== '') ? ' '+options.className : '';\n this.el.innerHTML = '
\\n
\\n
\\n
';\n if (targetElement.firstChild != null) {\n targetElement.insertBefore(this.el, targetElement.firstChild);\n } else {\n targetElement.appendChild(this.el);\n }\n }\n return this.el;\n };\n\n Bar.prototype.finish = function() {\n var el;\n el = this.getElement();\n el.className = el.className.replace('pace-active', 'pace-inactive');\n return document.body.className = document.body.className.replace('pace-running ', 'pace-done ');\n };\n\n Bar.prototype.update = function(prog) {\n this.progress = prog;\n Pace.trigger('progress', prog);\n return this.render();\n };\n\n Bar.prototype.destroy = function() {\n try {\n this.getElement().parentNode.removeChild(this.getElement());\n } catch (_error) {\n NoTargetError = _error;\n }\n return this.el = void 0;\n };\n\n Bar.prototype.render = function() {\n var el, key, progressStr, transform, _j, _len1, _ref2;\n if (document.querySelector(options.target) == null) {\n return false;\n }\n el = this.getElement();\n transform = \"translate3d(\" + this.progress + \"%, 0, 0)\";\n _ref2 = ['webkitTransform', 'msTransform', 'transform'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n key = _ref2[_j];\n el.children[0].style[key] = transform;\n }\n if (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) {\n el.children[0].setAttribute('data-progress-text', \"\" + (this.progress | 0) + \"%\");\n if (this.progress >= 100) {\n progressStr = '99';\n } else {\n progressStr = this.progress < 10 ? \"0\" : \"\";\n progressStr += this.progress | 0;\n }\n el.children[0].setAttribute('data-progress', \"\" + progressStr);\n }\n Pace.trigger('change', this.progress);\n return this.lastRenderedProgress = this.progress;\n };\n\n Bar.prototype.done = function() {\n return this.progress >= 100;\n };\n\n return Bar;\n\n })();\n\n Events = (function() {\n function Events() {\n this.bindings = {};\n }\n\n Events.prototype.trigger = function(name, val) {\n var binding, _j, _len1, _ref2, _results;\n if (this.bindings[name] != null) {\n _ref2 = this.bindings[name];\n _results = [];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n binding = _ref2[_j];\n _results.push(binding.call(this, val));\n }\n return _results;\n }\n };\n\n Events.prototype.on = function(name, fn) {\n var _base;\n if ((_base = this.bindings)[name] == null) {\n _base[name] = [];\n }\n return this.bindings[name].push(fn);\n };\n\n return Events;\n\n })();\n\n _XMLHttpRequest = window.XMLHttpRequest;\n\n _XDomainRequest = window.XDomainRequest;\n\n _WebSocket = window.WebSocket;\n\n extendNative = function(to, from) {\n var e, key, _results;\n _results = [];\n for (key in from.prototype) {\n try {\n if ((to[key] == null) && typeof from[key] !== 'function') {\n if (typeof Object.defineProperty === 'function') {\n _results.push(Object.defineProperty(to, key, {\n get: (function(key) {\n return function() {\n return from.prototype[key];\n };\n })(key),\n configurable: true,\n enumerable: true\n }));\n } else {\n _results.push(to[key] = from.prototype[key]);\n }\n } else {\n _results.push(void 0);\n }\n } catch (_error) {\n e = _error;\n }\n }\n return _results;\n };\n\n ignoreStack = [];\n\n Pace.ignore = function() {\n var args, fn, ret;\n fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n ignoreStack.unshift('ignore');\n ret = fn.apply(null, args);\n ignoreStack.shift();\n return ret;\n };\n\n Pace.track = function() {\n var args, fn, ret;\n fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n ignoreStack.unshift('track');\n ret = fn.apply(null, args);\n ignoreStack.shift();\n return ret;\n };\n\n shouldTrack = function(method) {\n var _ref2;\n if (method == null) {\n method = 'GET';\n }\n if (ignoreStack[0] === 'track') {\n return 'force';\n }\n if (!ignoreStack.length && options.ajax) {\n if (method === 'socket' && options.ajax.trackWebSockets) {\n return true;\n } else if (_ref2 = method.toUpperCase(), __indexOf.call(options.ajax.trackMethods, _ref2) >= 0) {\n return true;\n }\n }\n return false;\n };\n\n RequestIntercept = (function(_super) {\n __extends(RequestIntercept, _super);\n\n function RequestIntercept() {\n var monitorXHR,\n _this = this;\n RequestIntercept.__super__.constructor.apply(this, arguments);\n monitorXHR = function(req) {\n var _open;\n _open = req.open;\n return req.open = function(type, url, async) {\n if (shouldTrack(type)) {\n _this.trigger('request', {\n type: type,\n url: url,\n request: req\n });\n }\n return _open.apply(req, arguments);\n };\n };\n window.XMLHttpRequest = function(flags) {\n var req;\n req = new _XMLHttpRequest(flags);\n monitorXHR(req);\n return req;\n };\n try {\n extendNative(window.XMLHttpRequest, _XMLHttpRequest);\n } catch (_error) {}\n if (_XDomainRequest != null) {\n window.XDomainRequest = function() {\n var req;\n req = new _XDomainRequest;\n monitorXHR(req);\n return req;\n };\n try {\n extendNative(window.XDomainRequest, _XDomainRequest);\n } catch (_error) {}\n }\n if ((_WebSocket != null) && options.ajax.trackWebSockets) {\n window.WebSocket = function(url, protocols) {\n var req;\n if (protocols != null) {\n req = new _WebSocket(url, protocols);\n } else {\n req = new _WebSocket(url);\n }\n if (shouldTrack('socket')) {\n _this.trigger('request', {\n type: 'socket',\n url: url,\n protocols: protocols,\n request: req\n });\n }\n return req;\n };\n try {\n extendNative(window.WebSocket, _WebSocket);\n } catch (_error) {}\n }\n }\n\n return RequestIntercept;\n\n })(Events);\n\n _intercept = null;\n\n getIntercept = function() {\n if (_intercept == null) {\n _intercept = new RequestIntercept;\n }\n return _intercept;\n };\n\n shouldIgnoreURL = function(url) {\n var pattern, _j, _len1, _ref2;\n _ref2 = options.ajax.ignoreURLs;\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n pattern = _ref2[_j];\n if (typeof pattern === 'string') {\n if (url.indexOf(pattern) !== -1) {\n return true;\n }\n } else {\n if (pattern.test(url)) {\n return true;\n }\n }\n }\n return false;\n };\n\n getIntercept().on('request', function(_arg) {\n var after, args, request, type, url;\n type = _arg.type, request = _arg.request, url = _arg.url;\n if (shouldIgnoreURL(url)) {\n return;\n }\n if (!Pace.running && (options.restartOnRequestAfter !== false || shouldTrack(type) === 'force')) {\n args = arguments;\n after = options.restartOnRequestAfter || 0;\n if (typeof after === 'boolean') {\n after = 0;\n }\n return setTimeout(function() {\n var stillActive, _j, _len1, _ref2, _ref3, _results;\n if (type === 'socket') {\n stillActive = request.readyState < 1;\n } else {\n stillActive = (0 < (_ref2 = request.readyState) && _ref2 < 4);\n }\n if (stillActive) {\n Pace.restart();\n _ref3 = Pace.sources;\n _results = [];\n for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {\n source = _ref3[_j];\n if (source instanceof AjaxMonitor) {\n source.watch.apply(source, args);\n break;\n } else {\n _results.push(void 0);\n }\n }\n return _results;\n }\n }, after);\n }\n });\n\n AjaxMonitor = (function() {\n function AjaxMonitor() {\n this.complete = __bind(this.complete, this);\n var _this = this;\n this.elements = [];\n getIntercept().on('request', function() {\n return _this.watch.apply(_this, arguments);\n });\n }\n\n AjaxMonitor.prototype.watch = function(_arg) {\n var request, tracker, type, url;\n type = _arg.type, request = _arg.request, url = _arg.url;\n if (shouldIgnoreURL(url)) {\n return;\n }\n if (type === 'socket') {\n tracker = new SocketRequestTracker(request, this.complete);\n } else {\n tracker = new XHRRequestTracker(request, this.complete);\n }\n return this.elements.push(tracker);\n };\n\n AjaxMonitor.prototype.complete = function(tracker) {\n return this.elements = this.elements.filter(function(e) {\n return e !== tracker;\n });\n };\n\n return AjaxMonitor;\n\n })();\n\n XHRRequestTracker = (function() {\n function XHRRequestTracker(request, completeCallback) {\n var event, size, _j, _len1, _onreadystatechange, _ref2,\n _this = this;\n this.progress = 0;\n if (window.ProgressEvent != null) {\n size = null;\n addEventListener(request, 'progress', function(evt) {\n if (evt.lengthComputable) {\n return _this.progress = 100 * evt.loaded / evt.total;\n } else {\n return _this.progress = _this.progress + (100 - _this.progress) / 2;\n }\n }, false);\n _ref2 = ['load', 'abort', 'timeout', 'error'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n event = _ref2[_j];\n addEventListener(request, event, function() {\n completeCallback(_this);\n return _this.progress = 100;\n }, false);\n }\n } else {\n _onreadystatechange = request.onreadystatechange;\n request.onreadystatechange = function() {\n var _ref3;\n if ((_ref3 = request.readyState) === 0 || _ref3 === 4) {\n completeCallback(_this);\n _this.progress = 100;\n } else if (request.readyState === 3) {\n _this.progress = 50;\n }\n return typeof _onreadystatechange === \"function\" ? _onreadystatechange.apply(null, arguments) : void 0;\n };\n }\n }\n\n return XHRRequestTracker;\n\n })();\n\n SocketRequestTracker = (function() {\n function SocketRequestTracker(request, completeCallback) {\n var event, _j, _len1, _ref2,\n _this = this;\n this.progress = 0;\n _ref2 = ['error', 'open'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n event = _ref2[_j];\n addEventListener(request, event, function() {\n completeCallback(_this);\n return _this.progress = 100;\n }, false);\n }\n }\n\n return SocketRequestTracker;\n\n })();\n\n ElementMonitor = (function() {\n function ElementMonitor(options) {\n var selector, _j, _len1, _ref2;\n if (options == null) {\n options = {};\n }\n this.complete = __bind(this.complete, this);\n this.elements = [];\n if (options.selectors == null) {\n options.selectors = [];\n }\n _ref2 = options.selectors;\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n selector = _ref2[_j];\n this.elements.push(new ElementTracker(selector, this.complete));\n }\n }\n\n ElementMonitor.prototype.complete = function(tracker) {\n return this.elements = this.elements.filter(function(e) {\n return e !== tracker;\n });\n };\n\n return ElementMonitor;\n\n })();\n\n ElementTracker = (function() {\n function ElementTracker(selector, completeCallback) {\n this.selector = selector;\n this.completeCallback = completeCallback;\n this.progress = 0;\n this.check();\n }\n\n ElementTracker.prototype.check = function() {\n var _this = this;\n if (document.querySelector(this.selector)) {\n return this.done();\n } else {\n return setTimeout((function() {\n return _this.check();\n }), options.elements.checkInterval);\n }\n };\n\n ElementTracker.prototype.done = function() {\n this.completeCallback(this);\n this.completeCallback = null;\n return this.progress = 100;\n };\n\n return ElementTracker;\n\n })();\n\n DocumentMonitor = (function() {\n DocumentMonitor.prototype.states = {\n loading: 0,\n interactive: 50,\n complete: 100\n };\n\n function DocumentMonitor() {\n var _onreadystatechange, _ref2,\n _this = this;\n this.progress = (_ref2 = this.states[document.readyState]) != null ? _ref2 : 100;\n _onreadystatechange = document.onreadystatechange;\n document.onreadystatechange = function() {\n if (_this.states[document.readyState] != null) {\n _this.progress = _this.states[document.readyState];\n }\n return typeof _onreadystatechange === \"function\" ? _onreadystatechange.apply(null, arguments) : void 0;\n };\n }\n\n return DocumentMonitor;\n\n })();\n\n EventLagMonitor = (function() {\n function EventLagMonitor() {\n var avg, interval, last, points, samples,\n _this = this;\n this.progress = 0;\n avg = 0;\n samples = [];\n points = 0;\n last = now();\n interval = setInterval(function() {\n var diff;\n diff = now() - last - 50;\n last = now();\n samples.push(diff);\n if (samples.length > options.eventLag.sampleCount) {\n samples.shift();\n }\n avg = avgAmplitude(samples);\n if (++points >= options.eventLag.minSamples && avg < options.eventLag.lagThreshold) {\n _this.progress = 100;\n return clearInterval(interval);\n } else {\n return _this.progress = 100 * (3 / (avg + 3));\n }\n }, 50);\n }\n\n return EventLagMonitor;\n\n })();\n\n Scaler = (function() {\n function Scaler(source) {\n this.source = source;\n this.last = this.sinceLastUpdate = 0;\n this.rate = options.initialRate;\n this.catchup = 0;\n this.progress = this.lastProgress = 0;\n if (this.source != null) {\n this.progress = result(this.source, 'progress');\n }\n }\n\n Scaler.prototype.tick = function(frameTime, val) {\n var scaling;\n if (val == null) {\n val = result(this.source, 'progress');\n }\n if (val >= 100) {\n this.done = true;\n }\n if (val === this.last) {\n this.sinceLastUpdate += frameTime;\n } else {\n if (this.sinceLastUpdate) {\n this.rate = (val - this.last) / this.sinceLastUpdate;\n }\n this.catchup = (val - this.progress) / options.catchupTime;\n this.sinceLastUpdate = 0;\n this.last = val;\n }\n if (val > this.progress) {\n this.progress += this.catchup * frameTime;\n }\n scaling = 1 - Math.pow(this.progress / 100, options.easeFactor);\n this.progress += scaling * this.rate * frameTime;\n this.progress = Math.min(this.lastProgress + options.maxProgressPerFrame, this.progress);\n this.progress = Math.max(0, this.progress);\n this.progress = Math.min(100, this.progress);\n this.lastProgress = this.progress;\n return this.progress;\n };\n\n return Scaler;\n\n })();\n\n sources = null;\n\n scalers = null;\n\n bar = null;\n\n uniScaler = null;\n\n animation = null;\n\n cancelAnimation = null;\n\n Pace.running = false;\n\n handlePushState = function() {\n if (options.restartOnPushState) {\n return Pace.restart();\n }\n };\n\n if (window.history.pushState != null) {\n _pushState = window.history.pushState;\n window.history.pushState = function() {\n handlePushState();\n return _pushState.apply(window.history, arguments);\n };\n }\n\n if (window.history.replaceState != null) {\n _replaceState = window.history.replaceState;\n window.history.replaceState = function() {\n handlePushState();\n return _replaceState.apply(window.history, arguments);\n };\n }\n\n SOURCE_KEYS = {\n ajax: AjaxMonitor,\n elements: ElementMonitor,\n document: DocumentMonitor,\n eventLag: EventLagMonitor\n };\n\n (init = function() {\n var type, _j, _k, _len1, _len2, _ref2, _ref3, _ref4;\n Pace.sources = sources = [];\n _ref2 = ['ajax', 'elements', 'document', 'eventLag'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n type = _ref2[_j];\n if (options[type] !== false) {\n sources.push(new SOURCE_KEYS[type](options[type]));\n }\n }\n _ref4 = (_ref3 = options.extraSources) != null ? _ref3 : [];\n for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {\n source = _ref4[_k];\n sources.push(new source(options));\n }\n Pace.bar = bar = new Bar;\n scalers = [];\n return uniScaler = new Scaler;\n })();\n\n Pace.stop = function() {\n Pace.trigger('stop');\n Pace.running = false;\n bar.destroy();\n cancelAnimation = true;\n if (animation != null) {\n if (typeof cancelAnimationFrame === \"function\") {\n cancelAnimationFrame(animation);\n }\n animation = null;\n }\n return init();\n };\n\n Pace.restart = function() {\n Pace.trigger('restart');\n Pace.stop();\n return Pace.start();\n };\n\n Pace.go = function() {\n var start;\n Pace.running = true;\n bar.render();\n start = now();\n cancelAnimation = false;\n return animation = runAnimation(function(frameTime, enqueueNextFrame) {\n var avg, count, done, element, elements, i, j, remaining, scaler, scalerList, sum, _j, _k, _len1, _len2, _ref2;\n remaining = 100 - bar.progress;\n count = sum = 0;\n done = true;\n for (i = _j = 0, _len1 = sources.length; _j < _len1; i = ++_j) {\n source = sources[i];\n scalerList = scalers[i] != null ? scalers[i] : scalers[i] = [];\n elements = (_ref2 = source.elements) != null ? _ref2 : [source];\n for (j = _k = 0, _len2 = elements.length; _k < _len2; j = ++_k) {\n element = elements[j];\n scaler = scalerList[j] != null ? scalerList[j] : scalerList[j] = new Scaler(element);\n done &= scaler.done;\n if (scaler.done) {\n continue;\n }\n count++;\n sum += scaler.tick(frameTime);\n }\n }\n avg = sum / count;\n bar.update(uniScaler.tick(frameTime, avg));\n if (bar.done() || done || cancelAnimation) {\n bar.update(100);\n Pace.trigger('done');\n return setTimeout(function() {\n bar.finish();\n Pace.running = false;\n return Pace.trigger('hide');\n }, Math.max(options.ghostTime, Math.max(options.minTime - (now() - start), 0)));\n } else {\n return enqueueNextFrame();\n }\n });\n };\n\n Pace.start = function(_options) {\n extend(options, _options);\n Pace.running = true;\n try {\n bar.render();\n } catch (_error) {\n NoTargetError = _error;\n }\n if (!document.querySelector('.pace')) {\n return setTimeout(Pace.start, 50);\n } else {\n Pace.trigger('start');\n return Pace.go();\n }\n };\n\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Pace;\n });\n } else if (typeof exports === 'object') {\n module.exports = Pace;\n } else {\n if (options.startOnPageLoad) {\n Pace.start();\n }\n }\n\n}).call(this);"],"names":["AjaxMonitor","Bar","DocumentMonitor","ElementMonitor","ElementTracker","EventLagMonitor","Evented","Events","NoTargetError","Pace","RequestIntercept","SOURCE_KEYS","Scaler","SocketRequestTracker","XHRRequestTracker","addEventListener","animation","avgAmplitude","bar","cancelAnimation","cancelAnimationFrame","defaultOptions","extend","extendNative","getFromDOM","getIntercept","handlePushState","ignoreStack","init","now","options","requestAnimationFrame","result","runAnimation","scalers","shouldIgnoreURL","shouldTrack","source","sources","uniScaler","_WebSocket","_XDomainRequest","_XMLHttpRequest","_i","_intercept","_len","_pushState","_ref","_replaceState","__slice","slice","__hasProp","hasOwnProperty","__extends","child","parent","key","call","ctor","constructor","prototype","__super__","__indexOf","indexOf","item","i","l","this","length","__bind","fn","me","apply","arguments","className","catchupTime","initialRate","minTime","ghostTime","maxProgressPerFrame","easeFactor","startOnPageLoad","restartOnPushState","restartOnRequestAfter","target","elements","checkInterval","selectors","eventLag","minSamples","sampleCount","lagThreshold","ajax","trackMethods","trackWebSockets","ignoreURLs","performance","Date","window","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","mozCancelAnimationFrame","obj","event","callback","eventListeners","on","evt","trigger","setTimeout","id","clearTimeout","last","tick","diff","args","out","val","arr","count","sum","v","Math","abs","json","data","e","el","document","querySelector","getAttribute","JSON","parse","_error","console","error","handler","ctx","once","_base","bindings","push","off","_results","splice","_ref1","paceOptions","_super","Error","progress","getElement","targetElement","createElement","body","replace","_custom_class_name","innerHTML","firstChild","insertBefore","appendChild","finish","update","prog","render","destroy","parentNode","removeChild","progressStr","transform","_j","_len1","_ref2","children","style","lastRenderedProgress","setAttribute","done","name","binding","XMLHttpRequest","XDomainRequest","WebSocket","to","from","Object","defineProperty","get","configurable","enumerable","ignore","ret","unshift","shift","track","method","toUpperCase","monitorXHR","_this","req","_open","open","type","url","async","request","flags","protocols","pattern","test","_arg","after","running","_ref3","readyState","restart","watch","complete","tracker","filter","completeCallback","_onreadystatechange","ProgressEvent","lengthComputable","loaded","total","onreadystatechange","selector","check","states","loading","interactive","avg","interval","points","samples","setInterval","clearInterval","sinceLastUpdate","rate","catchup","lastProgress","frameTime","scaling","pow","min","max","history","pushState","replaceState","_k","_len2","_ref4","extraSources","stop","start","go","enqueueNextFrame","element","j","scaler","scalerList","_options","define","amd","exports","module"],"mappings":"CAKA,eACQA,YAAaC,IAAKC,gBAAiBC,eAAgBC,eAAgBC,gBAAiBC,QAASC,OAAQC,cAAeC,KAAMC,iBAAkBC,YAAaC,OAAQC,qBAAsBC,kBAAmBC,iBAAkBC,UAAWC,aAAcC,IAAKC,gBAAiBC,qBAAsBC,eAAgBC,OAAQC,aAAcC,WAAYC,aAAcC,gBAAiBC,YAAaC,KAAMC,IAAKC,QAASC,sBAAuBC,OAAQC,aAAcC,QAASC,gBAAiBC,YAAaC,OAAQC,QAASC,UAAWC,WAAYC,gBAAiBC,gBAAiBC,GAAIC,WAAYC,KAAMC,WAAYC,KAAaC,cAChmBC,QAAU,GAAGC,MACbC,UAAY,GAAGC,eACfC,UAAY,SAASC,MAAOC,YAAe,IAAIC,OAAOD,OAAcJ,UAAUM,KAAKF,OAAQC,OAAMF,MAAME,KAAOD,OAAOC,eAAiBE,YAAcC,YAAcL,aAASI,KAAKE,UAAYL,OAAOK,UAAWN,MAAMM,UAAY,IAAIF,KAAQJ,MAAMO,UAAYN,OAAOK,UAAkBN,OACvRQ,UAAY,GAAGC,SAAW,SAASC,UAAa,IAAIC,EAAI,EAAGC,EAAIC,KAAKC,OAAQH,EAAIC,EAAGD,OA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AoBuF,MAAQ,CAACvI,SACtB+B,OAAQsL,GAAKC,MAAOQ,IAAMT,GACxDQ,QAAU7K,SAAS8K,GAEnBlF,OADAmF,OAA0B,MAAjBC,WAAWF,GAAaE,WAAWF,GAAKE,WAAWF,GAAK,IAAIvP,OAAOsP,UAC7DjF,KACXmF,OAAOnF,OAGXzD,QACAC,KAAO2I,OAAOlJ,KAAKgI,mBAG3BV,IAAM/G,IAAMD,MACZtG,IAAIgJ,OAAO3H,UAAU2E,KAAKgI,UAAWV,MACjCtN,IAAI+J,QAAUA,MAAQ9J,iBACtBD,IAAIgJ,OAAO,KACXzJ,KAAKoG,QAAQ,QACNC,YAAW,kBACd5F,IAAI+I,SACJxJ,KAAK2M,SAAU,EACR3M,KAAKoG,QAAQ,UACrBc,KAAK2H,IAAIxN,QAAQgD,UAAW6C,KAAK2H,IAAIxN,QAAQ+C,SAAWhD,MAAQkO,OAAQ,MAEpEE,uBAKnBxP,KAAKsP,MAAQ,SAASO,UAClBhP,OAAOQ,QAASwO,UAChB7P,KAAK2M,SAAU,MAEXlM,IAAIkJ,SACN,MAAO9B,QACL9H,cAAgB8H,cAEfL,SAASC,cAAc,UAGxBzH,KAAKoG,QAAQ,SACNpG,KAAKuP,MAHLlJ,WAAWrG,KAAKsP,MAAO,KAOhB,mBAAXQ,QAAyBA,OAAOC,IACvCD,+BAAO,kBACI9P,QAEe,iBAAZgQ,QACdC,OAAOD,QAAUhQ,KAEbqB,QAAQmD,iBACRxE,KAAKsP,UAIdtM,KAAKU"} \ No newline at end of file +{"version":3,"file":"pace.min.js","sources":["../src/pace.js"],"sourcesContent":["/*!\n * pace.js v1.2.4\n * https://github.com/CodeByZach/pace/\n * Licensed MIT © HubSpot, Inc.\n */\n(function() {\n var AjaxMonitor, Bar, DocumentMonitor, ElementMonitor, ElementTracker, EventLagMonitor, Evented, Events, NoTargetError, Pace, RequestIntercept, SOURCE_KEYS, Scaler, SocketRequestTracker, XHRRequestTracker, addEventListener, animation, avgAmplitude, bar, cancelAnimation, cancelAnimationFrame, defaultOptions, extend, extendNative, getFromDOM, getIntercept, handlePushState, ignoreStack, init, now, options, requestAnimationFrame, result, runAnimation, scalers, shouldIgnoreURL, shouldTrack, source, sources, uniScaler, _WebSocket, _XDomainRequest, _XMLHttpRequest, _i, _intercept, _len, _pushState, _ref, _ref1, _replaceState,\n __slice = [].slice,\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\n\n defaultOptions = {\n className: '',\n catchupTime: 100,\n initialRate: .03,\n minTime: 250,\n ghostTime: 100,\n maxProgressPerFrame: 20,\n easeFactor: 1.25,\n startOnPageLoad: true,\n restartOnPushState: true,\n restartOnRequestAfter: 500,\n target: 'body',\n elements: {\n checkInterval: 100,\n selectors: ['body']\n },\n eventLag: {\n minSamples: 10,\n sampleCount: 3,\n lagThreshold: 3\n },\n ajax: {\n trackMethods: ['GET'],\n trackWebSockets: true,\n ignoreURLs: []\n }\n };\n\n now = function() {\n var _ref;\n return (_ref = typeof performance !== \"undefined\" && performance !== null ? typeof performance.now === \"function\" ? performance.now() : void 0 : void 0) != null ? _ref : +(new Date);\n };\n\n requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;\n\n cancelAnimationFrame = window.cancelAnimationFrame || window.mozCancelAnimationFrame;\n\n addEventListener = function(obj, event, callback) {\n if (typeof obj.addEventListener === \"function\") {\n return obj.addEventListener(event, callback, false);\n } else {\n return function() {\n if (typeof obj[\"on\" + event] !== \"function\" || typeof obj[\"on\" + event].eventListeners !== \"object\") {\n var eventListeners = new Events();\n if (typeof obj[\"on\" + event] === \"function\") {\n eventListeners.on(event, obj[\"on\" + event]);\n }\n obj[\"on\" + event] = function(evt) {\n return eventListeners.trigger(event, evt);\n };\n obj[\"on\" + event].eventListeners = eventListeners;\n } else {\n var eventListeners = obj[\"on\" + event].eventListeners;\n }\n eventListeners.on(event, callback);\n }();\n }\n };\n\n if (requestAnimationFrame == null) {\n requestAnimationFrame = function(fn) {\n return setTimeout(fn, 50);\n };\n cancelAnimationFrame = function(id) {\n return clearTimeout(id);\n };\n }\n\n runAnimation = function(fn) {\n var last, tick;\n last = now();\n tick = function() {\n var diff;\n diff = now() - last;\n if (diff >= 33) {\n last = now();\n return fn(diff, function() {\n return requestAnimationFrame(tick);\n });\n } else {\n return setTimeout(tick, 33 - diff);\n }\n };\n return tick();\n };\n\n result = function() {\n var args, key, obj;\n obj = arguments[0], key = arguments[1], args = 3 <= arguments.length ? __slice.call(arguments, 2) : [];\n if (typeof obj[key] === 'function') {\n return obj[key].apply(obj, args);\n } else {\n return obj[key];\n }\n };\n\n extend = function() {\n var key, out, source, sources, val, _i, _len;\n out = arguments[0], sources = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n for (_i = 0, _len = sources.length; _i < _len; _i++) {\n source = sources[_i];\n if (source) {\n for (key in source) {\n if (!__hasProp.call(source, key)) continue;\n val = source[key];\n if ((out[key] != null) && typeof out[key] === 'object' && (val != null) && typeof val === 'object') {\n extend(out[key], val);\n } else {\n out[key] = val;\n }\n }\n }\n }\n return out;\n };\n\n avgAmplitude = function(arr) {\n var count, sum, v, _i, _len;\n sum = count = 0;\n for (_i = 0, _len = arr.length; _i < _len; _i++) {\n v = arr[_i];\n sum += Math.abs(v);\n count++;\n }\n return sum / count;\n };\n\n getFromDOM = function(key, json) {\n var data, e, el;\n if (key == null) {\n key = 'options';\n }\n if (json == null) {\n json = true;\n }\n el = document.querySelector(\"[data-pace-\" + key + \"]\");\n if (!el) {\n return;\n }\n data = el.getAttribute(\"data-pace-\" + key);\n if (!json) {\n return data;\n }\n try {\n return JSON.parse(data);\n } catch (_error) {\n e = _error;\n return typeof console !== \"undefined\" && console !== null ? console.error(\"Error parsing inline pace options\", e) : void 0;\n }\n };\n\n Evented = (function() {\n function Evented() {}\n\n Evented.prototype.on = function(event, handler, ctx, once) {\n var _base;\n if (once == null) {\n once = false;\n }\n if (this.bindings == null) {\n this.bindings = {};\n }\n if ((_base = this.bindings)[event] == null) {\n _base[event] = [];\n }\n return this.bindings[event].push({\n handler: handler,\n ctx: ctx,\n once: once\n });\n };\n\n Evented.prototype.once = function(event, handler, ctx) {\n return this.on(event, handler, ctx, true);\n };\n\n Evented.prototype.off = function(event, handler) {\n var i, _ref, _results;\n if (((_ref = this.bindings) != null ? _ref[event] : void 0) == null) {\n return;\n }\n if (handler == null) {\n return delete this.bindings[event];\n } else {\n i = 0;\n _results = [];\n while (i < this.bindings[event].length) {\n if (this.bindings[event][i].handler === handler) {\n _results.push(this.bindings[event].splice(i, 1));\n } else {\n _results.push(i++);\n }\n }\n return _results;\n }\n };\n\n Evented.prototype.trigger = function() {\n var args, ctx, event, handler, i, once, _ref, _ref1, _results;\n event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n if ((_ref = this.bindings) != null ? _ref[event] : void 0) {\n i = 0;\n _results = [];\n while (i < this.bindings[event].length) {\n _ref1 = this.bindings[event][i], handler = _ref1.handler, ctx = _ref1.ctx, once = _ref1.once;\n handler.apply(ctx != null ? ctx : this, args);\n if (once) {\n _results.push(this.bindings[event].splice(i, 1));\n } else {\n _results.push(i++);\n }\n }\n return _results;\n }\n };\n\n return Evented;\n\n })();\n\n Pace = window.Pace || {};\n\n window.Pace = Pace;\n\n extend(Pace, Evented.prototype);\n\n options = Pace.options = extend({}, defaultOptions, window.paceOptions, getFromDOM());\n\n _ref = ['ajax', 'document', 'eventLag', 'elements'];\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n source = _ref[_i];\n if (options[source] === true) {\n options[source] = defaultOptions[source];\n }\n }\n\n NoTargetError = (function(_super) {\n __extends(NoTargetError, _super);\n\n function NoTargetError() {\n _ref1 = NoTargetError.__super__.constructor.apply(this, arguments);\n return _ref1;\n }\n\n return NoTargetError;\n\n })(Error);\n\n Bar = (function() {\n function Bar() {\n this.progress = 0;\n }\n\n Bar.prototype.getElement = function() {\n var targetElement;\n if (this.el == null) {\n targetElement = document.querySelector(options.target);\n if (!targetElement) {\n throw new NoTargetError;\n }\n this.el = document.createElement('div');\n this.el.className = \"pace pace-active\";\n document.body.className = document.body.className.replace(/(pace-done )|/, 'pace-running ');\n var _custom_class_name = (options.className !== '') ? ' '+options.className : '';\n this.el.innerHTML = '
\\n
\\n
\\n
';\n if (targetElement.firstChild != null) {\n targetElement.insertBefore(this.el, targetElement.firstChild);\n } else {\n targetElement.appendChild(this.el);\n }\n }\n return this.el;\n };\n\n Bar.prototype.finish = function() {\n var el;\n el = this.getElement();\n el.className = el.className.replace('pace-active', 'pace-inactive');\n return document.body.className = document.body.className.replace('pace-running ', 'pace-done ');\n };\n\n Bar.prototype.update = function(prog) {\n this.progress = prog;\n Pace.trigger('progress', prog);\n return this.render();\n };\n\n Bar.prototype.destroy = function() {\n try {\n this.getElement().parentNode.removeChild(this.getElement());\n } catch (_error) {\n NoTargetError = _error;\n }\n return this.el = void 0;\n };\n\n Bar.prototype.render = function() {\n var el, key, progressStr, transform, _j, _len1, _ref2;\n if (document.querySelector(options.target) == null) {\n return false;\n }\n el = this.getElement();\n transform = \"translate3d(\" + this.progress + \"%, 0, 0)\";\n _ref2 = ['webkitTransform', 'msTransform', 'transform'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n key = _ref2[_j];\n el.children[0].style[key] = transform;\n }\n if (!this.lastRenderedProgress || this.lastRenderedProgress | 0 !== this.progress | 0) {\n el.children[0].setAttribute('data-progress-text', \"\" + (this.progress | 0) + \"%\");\n if (this.progress >= 100) {\n progressStr = '99';\n } else {\n progressStr = this.progress < 10 ? \"0\" : \"\";\n progressStr += this.progress | 0;\n }\n el.children[0].setAttribute('data-progress', \"\" + progressStr);\n }\n Pace.trigger('change', this.progress);\n return this.lastRenderedProgress = this.progress;\n };\n\n Bar.prototype.done = function() {\n return this.progress >= 99;\n };\n\n return Bar;\n\n })();\n\n Events = (function() {\n function Events() {\n this.bindings = {};\n }\n\n Events.prototype.trigger = function(name, val) {\n var binding, _j, _len1, _ref2, _results;\n if (this.bindings[name] != null) {\n _ref2 = this.bindings[name];\n _results = [];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n binding = _ref2[_j];\n _results.push(binding.call(this, val));\n }\n return _results;\n }\n };\n\n Events.prototype.on = function(name, fn) {\n var _base;\n if ((_base = this.bindings)[name] == null) {\n _base[name] = [];\n }\n return this.bindings[name].push(fn);\n };\n\n return Events;\n\n })();\n\n _XMLHttpRequest = window.XMLHttpRequest;\n\n _XDomainRequest = window.XDomainRequest;\n\n _WebSocket = window.WebSocket;\n\n extendNative = function(to, from) {\n var e, key, _results;\n _results = [];\n for (key in from.prototype) {\n try {\n if ((to[key] == null) && typeof from[key] !== 'function') {\n if (typeof Object.defineProperty === 'function') {\n _results.push(Object.defineProperty(to, key, {\n get: (function(key) {\n return function() {\n return from.prototype[key];\n };\n })(key),\n configurable: true,\n enumerable: true\n }));\n } else {\n _results.push(to[key] = from.prototype[key]);\n }\n } else {\n _results.push(void 0);\n }\n } catch (_error) {\n e = _error;\n }\n }\n return _results;\n };\n\n ignoreStack = [];\n\n Pace.ignore = function() {\n var args, fn, ret;\n fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n ignoreStack.unshift('ignore');\n ret = fn.apply(null, args);\n ignoreStack.shift();\n return ret;\n };\n\n Pace.track = function() {\n var args, fn, ret;\n fn = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];\n ignoreStack.unshift('track');\n ret = fn.apply(null, args);\n ignoreStack.shift();\n return ret;\n };\n\n shouldTrack = function(method) {\n var _ref2;\n if (method == null) {\n method = 'GET';\n }\n if (ignoreStack[0] === 'track') {\n return 'force';\n }\n if (!ignoreStack.length && options.ajax) {\n if (method === 'socket' && options.ajax.trackWebSockets) {\n return true;\n } else if (_ref2 = method.toUpperCase(), __indexOf.call(options.ajax.trackMethods, _ref2) >= 0) {\n return true;\n }\n }\n return false;\n };\n\n RequestIntercept = (function(_super) {\n __extends(RequestIntercept, _super);\n\n function RequestIntercept() {\n var monitorXHR,\n _this = this;\n RequestIntercept.__super__.constructor.apply(this, arguments);\n monitorXHR = function(req) {\n var _open;\n _open = req.open;\n return req.open = function(type, url, async) {\n if (shouldTrack(type)) {\n _this.trigger('request', {\n type: type,\n url: url,\n request: req\n });\n }\n return _open.apply(req, arguments);\n };\n };\n window.XMLHttpRequest = function(flags) {\n var req;\n req = new _XMLHttpRequest(flags);\n monitorXHR(req);\n return req;\n };\n try {\n extendNative(window.XMLHttpRequest, _XMLHttpRequest);\n } catch (_error) {}\n if (_XDomainRequest != null) {\n window.XDomainRequest = function() {\n var req;\n req = new _XDomainRequest;\n monitorXHR(req);\n return req;\n };\n try {\n extendNative(window.XDomainRequest, _XDomainRequest);\n } catch (_error) {}\n }\n if ((_WebSocket != null) && options.ajax.trackWebSockets) {\n window.WebSocket = function(url, protocols) {\n var req;\n if (protocols != null) {\n req = new _WebSocket(url, protocols);\n } else {\n req = new _WebSocket(url);\n }\n if (shouldTrack('socket')) {\n _this.trigger('request', {\n type: 'socket',\n url: url,\n protocols: protocols,\n request: req\n });\n }\n return req;\n };\n try {\n extendNative(window.WebSocket, _WebSocket);\n } catch (_error) {}\n }\n }\n\n return RequestIntercept;\n\n })(Events);\n\n _intercept = null;\n\n getIntercept = function() {\n if (_intercept == null) {\n _intercept = new RequestIntercept;\n }\n return _intercept;\n };\n\n shouldIgnoreURL = function(url) {\n var pattern, _j, _len1, _ref2;\n _ref2 = options.ajax.ignoreURLs;\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n pattern = _ref2[_j];\n if (typeof pattern === 'string') {\n if (url.indexOf(pattern) !== -1) {\n return true;\n }\n } else {\n if (pattern.test(url)) {\n return true;\n }\n }\n }\n return false;\n };\n\n getIntercept().on('request', function(_arg) {\n var after, args, request, type, url;\n type = _arg.type, request = _arg.request, url = _arg.url;\n if (shouldIgnoreURL(url)) {\n return;\n }\n if (!Pace.running && (options.restartOnRequestAfter !== false || shouldTrack(type) === 'force')) {\n args = arguments;\n after = options.restartOnRequestAfter || 0;\n if (typeof after === 'boolean') {\n after = 0;\n }\n return setTimeout(function() {\n var stillActive, _j, _len1, _ref2, _ref3, _results;\n if (type === 'socket') {\n stillActive = request.readyState < 1;\n } else {\n stillActive = (0 < (_ref2 = request.readyState) && _ref2 < 4);\n }\n if (stillActive) {\n Pace.restart();\n _ref3 = Pace.sources;\n _results = [];\n for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {\n source = _ref3[_j];\n if (source instanceof AjaxMonitor) {\n source.watch.apply(source, args);\n break;\n } else {\n _results.push(void 0);\n }\n }\n return _results;\n }\n }, after);\n }\n });\n\n AjaxMonitor = (function() {\n function AjaxMonitor() {\n this.complete = __bind(this.complete, this);\n var _this = this;\n this.elements = [];\n getIntercept().on('request', function() {\n return _this.watch.apply(_this, arguments);\n });\n }\n\n AjaxMonitor.prototype.watch = function(_arg) {\n var request, tracker, type, url;\n type = _arg.type, request = _arg.request, url = _arg.url;\n if (shouldIgnoreURL(url)) {\n return;\n }\n if (type === 'socket') {\n tracker = new SocketRequestTracker(request, this.complete);\n } else {\n tracker = new XHRRequestTracker(request, this.complete);\n }\n return this.elements.push(tracker);\n };\n\n AjaxMonitor.prototype.complete = function(tracker) {\n return this.elements = this.elements.filter(function(e) {\n return e !== tracker;\n });\n };\n\n return AjaxMonitor;\n\n })();\n\n XHRRequestTracker = (function() {\n function XHRRequestTracker(request, completeCallback) {\n var event, size, _j, _len1, _onreadystatechange, _ref2,\n _this = this;\n this.progress = 0;\n if (window.ProgressEvent != null) {\n size = null;\n addEventListener(request, 'progress', function(evt) {\n if (evt.lengthComputable) {\n return _this.progress = 100 * evt.loaded / evt.total;\n } else {\n return _this.progress = _this.progress + (100 - _this.progress) / 2;\n }\n }, false);\n _ref2 = ['load', 'abort', 'timeout', 'error'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n event = _ref2[_j];\n addEventListener(request, event, function() {\n completeCallback(_this);\n return _this.progress = 100;\n }, false);\n }\n } else {\n _onreadystatechange = request.onreadystatechange;\n request.onreadystatechange = function() {\n var _ref3;\n if ((_ref3 = request.readyState) === 0 || _ref3 === 4) {\n completeCallback(_this);\n _this.progress = 100;\n } else if (request.readyState === 3) {\n _this.progress = 50;\n }\n return typeof _onreadystatechange === \"function\" ? _onreadystatechange.apply(null, arguments) : void 0;\n };\n }\n }\n\n return XHRRequestTracker;\n\n })();\n\n SocketRequestTracker = (function() {\n function SocketRequestTracker(request, completeCallback) {\n var event, _j, _len1, _ref2,\n _this = this;\n this.progress = 0;\n _ref2 = ['error', 'open'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n event = _ref2[_j];\n addEventListener(request, event, function() {\n completeCallback(_this);\n return _this.progress = 100;\n }, false);\n }\n }\n\n return SocketRequestTracker;\n\n })();\n\n ElementMonitor = (function() {\n function ElementMonitor(options) {\n var selector, _j, _len1, _ref2;\n if (options == null) {\n options = {};\n }\n this.complete = __bind(this.complete, this);\n this.elements = [];\n if (options.selectors == null) {\n options.selectors = [];\n }\n _ref2 = options.selectors;\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n selector = _ref2[_j];\n this.elements.push(new ElementTracker(selector, this.complete));\n }\n }\n\n ElementMonitor.prototype.complete = function(tracker) {\n return this.elements = this.elements.filter(function(e) {\n return e !== tracker;\n });\n };\n\n return ElementMonitor;\n\n })();\n\n ElementTracker = (function() {\n function ElementTracker(selector, completeCallback) {\n this.selector = selector;\n this.completeCallback = completeCallback;\n this.progress = 0;\n this.check();\n }\n\n ElementTracker.prototype.check = function() {\n var _this = this;\n if (document.querySelector(this.selector)) {\n return this.done();\n } else {\n return setTimeout((function() {\n return _this.check();\n }), options.elements.checkInterval);\n }\n };\n\n ElementTracker.prototype.done = function() {\n this.completeCallback(this);\n this.completeCallback = null;\n return this.progress = 100;\n };\n\n return ElementTracker;\n\n })();\n\n DocumentMonitor = (function() {\n DocumentMonitor.prototype.states = {\n loading: 0,\n interactive: 50,\n complete: 100\n };\n\n function DocumentMonitor() {\n var _onreadystatechange, _ref2,\n _this = this;\n this.progress = (_ref2 = this.states[document.readyState]) != null ? _ref2 : 100;\n _onreadystatechange = document.onreadystatechange;\n document.onreadystatechange = function() {\n if (_this.states[document.readyState] != null) {\n _this.progress = _this.states[document.readyState];\n }\n return typeof _onreadystatechange === \"function\" ? _onreadystatechange.apply(null, arguments) : void 0;\n };\n }\n\n return DocumentMonitor;\n\n })();\n\n EventLagMonitor = (function() {\n function EventLagMonitor() {\n var avg, interval, last, points, samples,\n _this = this;\n this.progress = 0;\n avg = 0;\n samples = [];\n points = 0;\n last = now();\n interval = setInterval(function() {\n var diff;\n diff = now() - last - 50;\n last = now();\n samples.push(diff);\n if (samples.length > options.eventLag.sampleCount) {\n samples.shift();\n }\n avg = avgAmplitude(samples);\n if (++points >= options.eventLag.minSamples && avg < options.eventLag.lagThreshold) {\n _this.progress = 100;\n return clearInterval(interval);\n } else {\n return _this.progress = 100 * (3 / (avg + 3));\n }\n }, 50);\n }\n\n return EventLagMonitor;\n\n })();\n\n Scaler = (function() {\n function Scaler(source) {\n this.source = source;\n this.last = this.sinceLastUpdate = 0;\n this.rate = options.initialRate;\n this.catchup = 0;\n this.progress = this.lastProgress = 0;\n if (this.source != null) {\n this.progress = result(this.source, 'progress');\n }\n }\n\n Scaler.prototype.tick = function(frameTime, val) {\n var scaling;\n if (val == null) {\n val = result(this.source, 'progress');\n }\n if (val >= 100) {\n this.done = true;\n }\n if (val === this.last) {\n this.sinceLastUpdate += frameTime;\n } else {\n if (this.sinceLastUpdate) {\n this.rate = (val - this.last) / this.sinceLastUpdate;\n }\n this.catchup = (val - this.progress) / options.catchupTime;\n this.sinceLastUpdate = 0;\n this.last = val;\n }\n if (val > this.progress) {\n this.progress += this.catchup * frameTime;\n }\n scaling = 1 - Math.pow(this.progress / 100, options.easeFactor);\n this.progress += scaling * this.rate * frameTime;\n this.progress = Math.min(this.lastProgress + options.maxProgressPerFrame, this.progress);\n this.progress = Math.max(0, this.progress);\n this.progress = Math.min(100, this.progress);\n this.lastProgress = this.progress;\n return this.progress;\n };\n\n return Scaler;\n\n })();\n\n sources = null;\n\n scalers = null;\n\n bar = null;\n\n uniScaler = null;\n\n animation = null;\n\n cancelAnimation = null;\n\n Pace.running = false;\n\n handlePushState = function() {\n if (options.restartOnPushState) {\n return Pace.restart();\n }\n };\n\n if (window.history.pushState != null) {\n _pushState = window.history.pushState;\n window.history.pushState = function() {\n handlePushState();\n return _pushState.apply(window.history, arguments);\n };\n }\n\n if (window.history.replaceState != null) {\n _replaceState = window.history.replaceState;\n window.history.replaceState = function() {\n handlePushState();\n return _replaceState.apply(window.history, arguments);\n };\n }\n\n SOURCE_KEYS = {\n ajax: AjaxMonitor,\n elements: ElementMonitor,\n document: DocumentMonitor,\n eventLag: EventLagMonitor\n };\n\n (init = function() {\n var type, _j, _k, _len1, _len2, _ref2, _ref3, _ref4;\n Pace.sources = sources = [];\n _ref2 = ['ajax', 'elements', 'document', 'eventLag'];\n for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {\n type = _ref2[_j];\n if (options[type] !== false) {\n sources.push(new SOURCE_KEYS[type](options[type]));\n }\n }\n _ref4 = (_ref3 = options.extraSources) != null ? _ref3 : [];\n for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) {\n source = _ref4[_k];\n sources.push(new source(options));\n }\n Pace.bar = bar = new Bar;\n scalers = [];\n return uniScaler = new Scaler;\n })();\n\n Pace.stop = function() {\n Pace.trigger('stop');\n Pace.running = false;\n bar.destroy();\n cancelAnimation = true;\n if (animation != null) {\n if (typeof cancelAnimationFrame === \"function\") {\n cancelAnimationFrame(animation);\n }\n animation = null;\n }\n return init();\n };\n\n Pace.restart = function() {\n Pace.trigger('restart');\n Pace.stop();\n return Pace.start();\n };\n\n Pace.go = function() {\n var start;\n Pace.running = true;\n bar.render();\n start = now();\n cancelAnimation = false;\n return animation = runAnimation(function(frameTime, enqueueNextFrame) {\n var avg, count, done, element, elements, i, j, remaining, scaler, scalerList, sum, _j, _k, _len1, _len2, _ref2;\n remaining = 100 - bar.progress;\n count = sum = 0;\n done = true;\n for (i = _j = 0, _len1 = sources.length; _j < _len1; i = ++_j) {\n source = sources[i];\n scalerList = scalers[i] != null ? scalers[i] : scalers[i] = [];\n elements = (_ref2 = source.elements) != null ? _ref2 : [source];\n for (j = _k = 0, _len2 = elements.length; _k < _len2; j = ++_k) {\n element = elements[j];\n scaler = scalerList[j] != null ? scalerList[j] : scalerList[j] = new Scaler(element);\n done &= scaler.done;\n if (scaler.done) {\n continue;\n }\n count++;\n sum += scaler.tick(frameTime);\n }\n }\n avg = sum / count;\n bar.update(uniScaler.tick(frameTime, avg));\n if (bar.done() || done || cancelAnimation) {\n bar.update(100);\n Pace.trigger('done');\n return setTimeout(function() {\n bar.finish();\n Pace.running = false;\n return Pace.trigger('hide');\n }, Math.max(options.ghostTime, Math.max(options.minTime - (now() - start), 0)));\n } else {\n return enqueueNextFrame();\n }\n });\n };\n\n Pace.start = function(_options) {\n extend(options, _options);\n Pace.running = true;\n try {\n bar.render();\n } catch (_error) {\n NoTargetError = _error;\n }\n if (!document.querySelector('.pace')) {\n return setTimeout(Pace.start, 50);\n } else {\n Pace.trigger('start');\n return Pace.go();\n }\n };\n\n if (typeof define === 'function' && define.amd) {\n define(function() {\n return Pace;\n });\n } else if (typeof exports === 'object') {\n module.exports = Pace;\n } else {\n if (options.startOnPageLoad) {\n Pace.start();\n }\n }\n\n}).call(this);"],"names":["AjaxMonitor","Bar","DocumentMonitor","ElementMonitor","ElementTracker","EventLagMonitor","Evented","Events","NoTargetError","Pace","RequestIntercept","SOURCE_KEYS","Scaler","SocketRequestTracker","XHRRequestTracker","addEventListener","animation","avgAmplitude","bar","cancelAnimation","cancelAnimationFrame","defaultOptions","extend","extendNative","getFromDOM","getIntercept","handlePushState","ignoreStack","init","now","options","requestAnimationFrame","result","runAnimation","scalers","shouldIgnoreURL","shouldTrack","source","sources","uniScaler","_WebSocket","_XDomainRequest","_XMLHttpRequest","_i","_intercept","_len","_pushState","_ref","_replaceState","__slice","slice","__hasProp","hasOwnProperty","__extends","child","parent","key","call","ctor","constructor","prototype","__super__","__indexOf","indexOf","item","i","l","this","length","__bind","fn","me","apply","arguments","className","catchupTime","initialRate","minTime","ghostTime","maxProgressPerFrame","easeFactor","startOnPageLoad","restartOnPushState","restartOnRequestAfter","target","elements","checkInterval","selectors","eventLag","minSamples","sampleCount","lagThreshold","ajax","trackMethods","trackWebSockets","ignoreURLs","performance","Date","window","mozRequestAnimationFrame","webkitRequestAnimationFrame","msRequestAnimationFrame","mozCancelAnimationFrame","obj","event","callback","eventListeners","on","evt","trigger","setTimeout","id","clearTimeout","last","tick","diff","args","out","val","arr","count","sum","v","Math","abs","json","data","e","el","document","querySelector","getAttribute","JSON","parse","_error","console","error","handler","ctx","once","_base","bindings","push","off","_results","splice","_ref1","paceOptions","_super","Error","progress","getElement","targetElement","createElement","body","replace","_custom_class_name","innerHTML","firstChild","insertBefore","appendChild","finish","update","prog","render","destroy","parentNode","removeChild","progressStr","transform","_j","_len1","_ref2","children","style","lastRenderedProgress","setAttribute","done","name","binding","XMLHttpRequest","XDomainRequest","WebSocket","to","from","Object","defineProperty","get","configurable","enumerable","ignore","ret","unshift","shift","track","method","toUpperCase","monitorXHR","_this","req","_open","open","type","url","async","request","flags","protocols","pattern","test","_arg","after","running","_ref3","readyState","restart","watch","complete","tracker","filter","completeCallback","_onreadystatechange","ProgressEvent","lengthComputable","loaded","total","onreadystatechange","selector","check","states","loading","interactive","avg","interval","points","samples","setInterval","clearInterval","sinceLastUpdate","rate","catchup","lastProgress","frameTime","scaling","pow","min","max","history","pushState","replaceState","_k","_len2","_ref4","extraSources","stop","start","go","enqueueNextFrame","element","j","scaler","scalerList","_options","define","amd","exports","module"],"mappings":"CAKA,eACQA,YAAaC,IAAKC,gBAAiBC,eAAgBC,eAAgBC,gBAAiBC,QAASC,OAAQC,cAAeC,KAAMC,iBAAkBC,YAAaC,OAAQC,qBAAsBC,kBAAmBC,iBAAkBC,UAAWC,aAAcC,IAAKC,gBAAiBC,qBAAsBC,eAAgBC,OAAQC,aAAcC,WAAYC,aAAcC,gBAAiBC,YAAaC,KAAMC,IAAKC,QAASC,sBAAuBC,OAAQC,aAAcC,QAASC,gBAAiBC,YAAaC,OAAQC,QAASC,UAAWC,WAAYC,gBAAiBC,gBAAiBC,GAAIC,WAAYC,KAAMC,WAAYC,KAAaC,cAChmBC,QAAU,GAAGC,MACbC,UAAY,GAAGC,eACfC,UAAY,SAASC,MAAOC,YAAe,IAAIC,OAAOD,OAAcJ,UAAUM,KAAKF,OAAQC,OAAMF,MAAME,KAAOD,OAAOC,eAAiBE,YAAcC,YAAcL,aAASI,KAAKE,UAAYL,OAAOK,UAAWN,MAAMM,UAAY,IAAIF,KAAQJ,MAAMO,UAAYN,OAAOK,UAAkBN,OACvRQ,UAAY,GAAGC,SAAW,SAASC,UAAa,IAAIC,EAAI,EAAGC,EAAIC,KAAKC,OAAQH,EAAIC,EAAGD,OAAWA,KAAKE,MAAQA,KAAKF,KAAOD,KAAM,OAAOC,SAAa,GACjJI,OAAS,SAASC,GAAIC,WAAY,kBAAmBD,GAAGE,MAAMD,GAAIE,iBAEtEpD,eAAiB,CACbqD,UAAW,GACXC,YAAa,IACbC,YAAa,IACbC,QAAS,IACTC,UAAW,IACXC,oBAAqB,GACrBC,WAAY,KACZC,iBAAiB,EACjBC,oBAAoB,EACpBC,sBAAuB,IACvBC,OAAQ,OACRC,SAAU,CACNC,cAAe,IACfC,UAAW,CAAC,SAEhBC,SAAU,CACNC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AQ9J,iBACtBD,IAAIgJ,OAAO,KACXzJ,KAAKoG,QAAQ,QACNC,YAAW,kBACd5F,IAAI+I,SACJxJ,KAAK2M,SAAU,EACR3M,KAAKoG,QAAQ,UACrBc,KAAK2H,IAAIxN,QAAQgD,UAAW6C,KAAK2H,IAAIxN,QAAQ+C,SAAWhD,MAAQkO,OAAQ,MAEpEE,uBAKnBxP,KAAKsP,MAAQ,SAASO,UAClBhP,OAAOQ,QAASwO,UAChB7P,KAAK2M,SAAU,MAEXlM,IAAIkJ,SACN,MAAO9B,QACL9H,cAAgB8H,cAEfL,SAASC,cAAc,UAGxBzH,KAAKoG,QAAQ,SACNpG,KAAKuP,MAHLlJ,WAAWrG,KAAKsP,MAAO,KAOhB,mBAAXQ,QAAyBA,OAAOC,IACvCD,+BAAO,kBACI9P,QAEe,iBAAZgQ,QACdC,OAAOD,QAAUhQ,KAEbqB,QAAQmD,iBACRxE,KAAKsP,UAIdtM,KAAKU"} \ No newline at end of file diff --git a/amd/build/pace_init.min.js b/amd/build/pace_init.min.js new file mode 100644 index 0000000..ab5408b --- /dev/null +++ b/amd/build/pace_init.min.js @@ -0,0 +1,5 @@ +define("theme_adaptable/pace_init",["exports","theme_adaptable/pace","core/log"],(function(_exports,_pace,_log){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}} +// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. +Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0,_pace=_interopRequireDefault(_pace),_log=_interopRequireDefault(_log);_exports.init=data=>{_log.default.debug("Adaptable ES6 Pace init "+data),document.body.classList.add("pace-"+data),_pace.default.start({restartOnRequestAfter:!1})}})); + +//# sourceMappingURL=pace_init.min.js.map \ No newline at end of file diff --git a/amd/build/pace_init.min.js.map b/amd/build/pace_init.min.js.map new file mode 100644 index 0000000..304da30 --- /dev/null +++ b/amd/build/pace_init.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"pace_init.min.js","sources":["../src/pace_init.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see .\n\n//\n// Pace init.\n//\n// @module theme_adaptable/collapseblock\n// @copyright 2023 G J Barnard.\n// @author G J Barnard -\n// {@link https://moodle.org/user/profile.php?id=442195}\n// {@link https://gjbarnard.co.uk}\n// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.\n//\n\nimport pace from 'theme_adaptable/pace';\nimport log from 'core/log';\n\nexport const init = (data) => {\n log.debug('Adaptable ES6 Pace init ' + data);\n document.body.classList.add('pace-' + data);\n pace.start({\n restartOnRequestAfter: false\n });\n};\n"],"names":["data","debug","document","body","classList","add","start","restartOnRequestAfter"],"mappings":";;iKA6BqBA,oBACbC,MAAM,2BAA6BD,MACvCE,SAASC,KAAKC,UAAUC,IAAI,QAAUL,oBACjCM,MAAM,CACPC,uBAAuB"} \ No newline at end of file diff --git a/amd/src/adaptable.js b/amd/src/adaptable.js index 6b92ef2..373fc4f 100644 --- a/amd/src/adaptable.js +++ b/amd/src/adaptable.js @@ -29,7 +29,6 @@ import $ from 'jquery'; import jqueryeasingInit from 'theme_adaptable/jqueryeasing'; -import pace from 'theme_adaptable/pace'; import * as AdaptableUtil from 'theme_adaptable/util'; import log from 'core/log'; @@ -346,9 +345,6 @@ const options = (data) => { export const init = (data) => { log.debug('Adaptable ES6 init'); jqueryeasingInit(); - pace.start({ - document: false - }); /* Conditional javascript to resolve anchor link clicking issue with sticky navbar. in old bootstrap version. Re: issue #919. Original issue / solution discussion here: https://github.com/twbs/bootstrap/issues/1768. */ diff --git a/amd/src/pace.js b/amd/src/pace.js index 966cc4c..fd0a4c9 100644 --- a/amd/src/pace.js +++ b/amd/src/pace.js @@ -334,7 +334,7 @@ }; Bar.prototype.done = function() { - return this.progress >= 100; + return this.progress >= 99; }; return Bar; diff --git a/amd/src/pace_init.js b/amd/src/pace_init.js new file mode 100644 index 0000000..27dbcfc --- /dev/null +++ b/amd/src/pace_init.js @@ -0,0 +1,36 @@ +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . + +// +// Pace init. +// +// @module theme_adaptable/collapseblock +// @copyright 2023 G J Barnard. +// @author G J Barnard - +// {@link https://moodle.org/user/profile.php?id=442195} +// {@link https://gjbarnard.co.uk} +// @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. +// + +import pace from 'theme_adaptable/pace'; +import log from 'core/log'; + +export const init = (data) => { + log.debug('Adaptable ES6 Pace init ' + data); + document.body.classList.add('pace-' + data); + pace.start({ + restartOnRequestAfter: false + }); +}; diff --git a/classes/output/core_renderer_layout.php b/classes/output/core_renderer_layout.php index 9fe4eb0..3e6b726 100644 --- a/classes/output/core_renderer_layout.php +++ b/classes/output/core_renderer_layout.php @@ -65,6 +65,9 @@ public function yesheader($sidepostdrawer) { // JS calls. $this->page->requires->js_call_amd('theme_adaptable/adaptable', 'init', $optionsdata); + if (!empty($themesettings->pageloadingprogress)) { + $this->page->requires->js_call_amd('theme_adaptable/pace_init', 'init', [$themesettings->pageloadingprogresstheme]); + } // Layout. $left = (!right_to_left()); @@ -393,6 +396,10 @@ public function noheader() { theme_adaptable_initialise_full(); $bodyclasses[] = theme_adaptable_get_full(); + if (!empty($themesettings->pageloadingprogress)) { + $this->page->requires->js_call_amd('theme_adaptable/pace_init', 'init', [$themesettings->pageloadingprogresstheme]); + } + // Include header. $this->head($bodyclasses); diff --git a/classes/output/external.php b/classes/output/external.php index b523bb2..3e2c953 100644 --- a/classes/output/external.php +++ b/classes/output/external.php @@ -26,12 +26,14 @@ namespace theme_adaptable\output; +use context_system; use core_external\external_api; use core_external\external_function_parameters; use core_external\external_multiple_structure; use core_external\external_single_structure; use core_external\external_value; use core_external\external_warnings; +use core\external\output\icon_system; use core\external\output\icon_system\load_fontawesome_map; use core_user; @@ -54,7 +56,7 @@ public static function load_fontawesome_icon_map_parameters(): external_function * @return array the mapping */ public static function load_fontawesome_icon_map() { - $instance = \core\output\icon_system::instance('\\theme_adaptable\\output\\icon_system_fontawesome'); + $instance = icon_system::instance('\\theme_adaptable\\output\\icon_system_fontawesome'); $map = $instance->get_icon_name_map(); $result = []; @@ -113,7 +115,7 @@ public static function set_user_preferences($preferences) { $warnings = []; $saved = []; - $context = \context_system::instance(); + $context = context_system::instance(); $PAGE->set_context($context); $userscache = []; diff --git a/lang/en/theme_adaptable.php b/lang/en/theme_adaptable.php index 1796450..8fd52ea 100644 --- a/lang/en/theme_adaptable.php +++ b/lang/en/theme_adaptable.php @@ -135,7 +135,7 @@ $string['settingsfootercolors'] = 'Footer colours'; $string['settingsfonts'] = 'Fonts'; $string['settingsanalytics'] = 'Analytics'; -$string['settingsblocksgeneral'] = 'General'; +$string['settingsblocksconfiguration'] = 'Configuration'; $string['settingsborders'] = 'Borders'; $string['settingscolors'] = 'Colours'; $string['settingscourses'] = 'Courses'; @@ -143,12 +143,11 @@ $string['settingsblockicons'] = 'Icons'; // Admin Settings Strings. -$string['settingspageblocksettings'] = 'Block'; $string['settingspagealertsettings'] = 'Alerts'; -$string['frontpageblockregionsettings'] = 'Block region builder'; -$string['dashboardblockregionsettings'] = 'Dashboard block region builder'; +$string['settingspageblocksettings'] = 'Block'; $string['coursepageblockregionsettings'] = 'Course page block region builder'; -$string['frontpageblocksettings'] = 'Marketing blocks'; +$string['dashboardblockregionsettings'] = 'Dashboard block region builder'; +$string['settingspagefrontpageblockregionsettings'] = 'Frontpage block region builder'; $string['frontpageslidersettings'] = 'Frontpage slider'; $string['frontpagecoursesettings'] = 'Frontpage courses list'; $string['frontpagesettingsheading'] = 'Frontpage rendering'; @@ -159,6 +158,8 @@ $string['frontpagerendereroption2'] = 'Tiles w/ overlay'; $string['frontpagerendereroption3'] = 'Moodle default'; $string['frontpagerendereroption4'] = 'Coventry tiles'; +$string['frontpageblocksettings'] = 'Marketing blocks'; +$string['settingspagegeneralsettings'] = 'General'; $string['informationblocksettings'] = 'Information blocks'; $string['newstickersettings'] = 'News ticker'; @@ -1066,6 +1067,31 @@ $string['slight'] = 'Slight'; $string['standard'] = 'Standard'; +// General. +$string['pageloadingprogress'] = 'Page loading progress'; +$string['pageloadingprogressdesc'] = 'Show the page loading progress.'; + +$string['pageloadingprogresstheme'] = 'Page loading theme'; +$string['pageloadingprogressthemedesc'] = 'Set the page loading theme.'; + +$string['pageloadingprogressthemebarbershop'] = 'Barber shop'; +$string['pageloadingprogressthemebigcounter'] = 'Big counter'; +$string['pageloadingprogressthemebounce'] = 'Bounce'; +$string['pageloadingprogressthemecenteratom'] = 'Center atom'; +$string['pageloadingprogressthemecentercircle'] = 'Center circle'; +$string['pageloadingprogressthemecenterradar'] = 'Center radar'; +$string['pageloadingprogressthemecentersimple'] = 'Center simple'; +$string['pageloadingprogressthemecornerindicator'] = 'Corner indicator'; +$string['pageloadingprogressthemefillleft'] = 'Fill left'; +$string['pageloadingprogressthemeflash'] = 'Flash'; +$string['pageloadingprogressthemeflattop'] = 'Flat top'; +$string['pageloadingprogressthemeloadingbar'] = 'Loading bar'; +$string['pageloadingprogressthememacosx'] = 'Mac OSX'; +$string['pageloadingprogressthememinimal'] = 'Minimal'; + +$string['loadingcolor'] = 'Page loading colour'; +$string['loadingcolordesc'] = 'The loading bar colour.'; + // Login button. $string['logintextbutton'] = 'Log in'; $string['logintextbuttonwhenoidc'] = 'Guest/Manual Login'; @@ -1189,9 +1215,6 @@ $string['thiscourse'] = 'This course'; $string['coursesections'] = 'Course sections'; -$string['loadingcolor'] = 'Loading colour'; -$string['loadingcolordesc'] = 'The loading bar colour in the top of the page.'; - $string['sitetitle'] = 'Display site title'; $string['sitetitledesc'] = 'Display the default Moodle site title from Front Page Settings or enter a custom site title in the text box below.'; @@ -1515,9 +1538,9 @@ $string['custommenutitledesc'] = 'Set the title of the custom menu title that will contain all of the custom menus on the navbar. If empty then each top level entry will create a new menu on the navbar.'; $string['headernavbarcustommenucoreheading'] = 'Core settings'; -$string['headernavbarcustommenucoreheadingdesc'] = 'Duplicated for convenience.'; +$string['headernavbarcustommenucoreheadingdesc'] = 'Shown for convenience. Please navigate to \'Advanced theme settings\' under \'Appearance\'.'; -$string['custommenuitemscoredesc'] = 'A custom menu may be configured here. Enter each menu item on a new line. Lines starting with a hyphen will appear as menu items in the previous top level menu and ### makes a divider.'; +$string['custommenuitemscoredesc'] = 'A custom menu may be configured in the core setting. Enter each menu item on a new line. Lines starting with a hyphen will appear as menu items in the previous top level menu and ### makes a divider.'; $string['customusermenuitemscoredesc'] = 'You can configure the contents of the user menu (with the exception of the log out link, which is automatically added). Each line is separated by pipe characters and consists of 1) a string in "langstringname, componentname" form or as plain text, 2) a URL, and 3) a Font Awesome icon name or CSS classes (optional). Dividers can be used by adding a line of one or more # characters where desired. To find the FontAwesome(Free) classes for the icon you wish to use, go to Font Awesome free and search for the icon. You can use the name, such as \'graduation-cap\' or the complete list of classes \'fa-solid fa-graduation-cap\'. For example:
 messages,message|/message/index.php|fa-regular fa-comment
@@ -1525,6 +1548,8 @@
 
Note: The default core value may contain duplicates, please adjust as desired. '; +$string['headernavbarcustommenucoreempty'] = 'Setting \'{$a}\' is empty.'; +$string['headernavbarcustommenucorenotempty'] = 'Setting \'{$a}\' is:

'; // Tool menus. $string['newmenudesc'] = 'Configure links to be shown under a top header menu.'; diff --git a/lib.php b/lib.php index 1a353e9..6f33340 100644 --- a/lib.php +++ b/lib.php @@ -51,27 +51,32 @@ function theme_adaptable_pre_scss($theme) { $regionmaincolor = \theme_adaptable\toolbox::get_setting('regionmaincolor', false, $theme->name, '#ffffff'); $fontcolor = \theme_adaptable\toolbox::get_setting('fontcolor', false, $theme->name, '#333333'); - $fontcolorrgba = \theme_adaptable\toolbox::hex2rgba(\theme_adaptable\toolbox::get_setting('fontcolor'), 0.25); - $prescss = '$body-bg: ' . $regionmaincolor . ';'; - $prescss = '$body-color: ' . $fontcolor . ';'; - $prescss .= '$primary: ' . \theme_adaptable\toolbox::get_setting('primarycolour', false, $theme->name, '#00796b') . ';'; - $prescss .= '$secondary: ' . \theme_adaptable\toolbox::get_setting('secondarycolour', false, $theme->name, '#009688') . ';'; - $prescss .= '$nav-tabs-border-color: $secondary;'; - $prescss .= '$dialogue-base-bg: ' . $regionmaincolor . ';'; - $prescss .= '$nav-tabs-link-active-border-color: ' . $fontcolorrgba .' ' . $fontcolorrgba . ' transparent;'; - $prescss .= '$nav-tabs-link-hover-border-color: transparent transparent '. $fontcolor . ';'; + $fontcolorrgba = \theme_adaptable\toolbox::hex2rgba($fontcolor, 0.25); + $prescss = '$body-bg: ' . $regionmaincolor . ';' . PHP_EOL; + $prescss = '$body-color: ' . $fontcolor . ';' . PHP_EOL; + $prescss .= '$primary: ' . \theme_adaptable\toolbox::get_setting('primarycolour', false, $theme->name, '#00796b') . ';' . PHP_EOL; + $prescss .= '$secondary: ' . \theme_adaptable\toolbox::get_setting('secondarycolour', false, $theme->name, '#009688') . ';' . PHP_EOL; + $prescss .= '$loadingcolor: ' . \theme_adaptable\toolbox::get_setting('loadingcolor', false, $theme->name, '#00B3A1') . ';' . PHP_EOL; + $loadingcolor = \theme_adaptable\toolbox::get_setting('loadingcolor', false, $theme->name, '#00B3A1'); + $loadingcolorrgba = \theme_adaptable\toolbox::hex2rgba($loadingcolor, 0.2); + $prescss .= '$loadingcolor: ' . $loadingcolor . ';' . PHP_EOL; + $prescss .= '$loadingcolorrgba: ' . $loadingcolorrgba . ';' . PHP_EOL; + $prescss .= '$nav-tabs-border-color: $secondary;' . PHP_EOL; + $prescss .= '$dialogue-base-bg: ' . $regionmaincolor . ';' . PHP_EOL; + $prescss .= '$nav-tabs-link-active-border-color: ' . $fontcolorrgba .' ' . $fontcolorrgba . ' transparent;' . PHP_EOL; + $prescss .= '$nav-tabs-link-hover-border-color: transparent transparent '. $fontcolor . ';' . PHP_EOL; $prescss .= '$courseindex-link-color: ' . - \theme_adaptable\toolbox::get_setting('courseindexitemcolor', false, $theme->name, '#495057') . ';'; + \theme_adaptable\toolbox::get_setting('courseindexitemcolor', false, $theme->name, '#495057') . ';' . PHP_EOL; $prescss .= '$courseindex-link-hover-color: ' . - \theme_adaptable\toolbox::get_setting('courseindexitemhovercolor', false, $theme->name, '#e6e6e6') . ';'; + \theme_adaptable\toolbox::get_setting('courseindexitemhovercolor', false, $theme->name, '#e6e6e6') . ';' . PHP_EOL; $prescss .= '$courseindex-link-color-selected: ' . - \theme_adaptable\toolbox::get_setting('courseindexpageitemcolor', false, $theme->name, '#ffffff') . ';'; + \theme_adaptable\toolbox::get_setting('courseindexpageitemcolor', false, $theme->name, '#ffffff') . ';' . PHP_EOL; $prescss .= '$courseindex-item-page-bg: ' . - \theme_adaptable\toolbox::get_setting('courseindexpageitembgcolor', false, $theme->name, '#0f6cbf') . ';'; + \theme_adaptable\toolbox::get_setting('courseindexpageitembgcolor', false, $theme->name, '#0f6cbf') . ';' . PHP_EOL; $prescss .= '$drawer-bg-color: #fff;'; // Currently no setting for 'block region' background. $prescss .= '$input-btn-focus-color: rgba(' . \theme_adaptable\toolbox::get_setting('inputbuttonfocuscolour', false, $theme->name, '#0f6cc0') . ', ' . - \theme_adaptable\toolbox::get_setting('inputbuttonfocuscolouropacity', false, $theme->name, '0.75') . ');'; + \theme_adaptable\toolbox::get_setting('inputbuttonfocuscolouropacity', false, $theme->name, '0.75') . ');' . PHP_EOL; return $prescss; } diff --git a/scss/main.scss b/scss/main.scss index 9de17f6..73a4a95 100644 --- a/scss/main.scss +++ b/scss/main.scss @@ -19,5 +19,6 @@ @import "nosettings/modal"; @import "nosettings/navigation"; @import "nosettings/notifications"; +@import "nosettings/pace"; @import "nosettings/secondarynavigation"; @import "nosettings/user"; diff --git a/scss/nosettings/_pace.scss b/scss/nosettings/_pace.scss new file mode 100644 index 0000000..46c50c4 --- /dev/null +++ b/scss/nosettings/_pace.scss @@ -0,0 +1,1812 @@ +// +// This file is part of Moodle - http://moodle.org/ +// +// Moodle is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// Moodle is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Moodle. If not, see . +// +// +// Adaptable Pace Stylesheet +// +// @package theme_adaptable +// @copyright © 2024 - G J Barnard +// @author G J Barnard - {@link http://moodle.org/user/profile.php?id=442195} +// @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later +// + +// From https://codebyzach.github.io/pace/. + +// Minimal. +.pace-minimal { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } + + .pace-inactive { + display: none; + } + + .pace .pace-progress { + background: $loadingcolor; + position: fixed; + z-index: 2000; + top: 0; + right: 100%; + width: 100%; + height: 2px; + } +} + +// Barber shop. +.pace-barber_shop { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + overflow: hidden; + position: fixed; + top: 0; + left: 0; + z-index: 2000; + width: 100%; + height: 12px; + background: #fff; + } + + .pace-inactive { + display: none; + } + + .pace .pace-progress { + background-color: $loadingcolor; + position: fixed; + top: 0; + bottom: 0; + right: 100%; + width: 100%; + overflow: hidden; + height: 12px; + } + + .pace .pace-activity { + position: fixed; + top: 0; + right: -32px; + bottom: 0; + left: 0; + height: 12px; + + -webkit-transform: translate3d(0, 0, 0); + -moz-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + + background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.2)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.2)), color-stop(0.75, rgba(255, 255, 255, 0.2)), color-stop(0.75, transparent), to(transparent)); + background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + background-image: -moz-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent); + -webkit-background-size: 32px 32px; + -moz-background-size: 32px 32px; + -o-background-size: 32px 32px; + background-size: 32px 32px; + + -webkit-animation: pace-theme-barber-shop-motion 500ms linear infinite; + -moz-animation: pace-theme-barber-shop-motion 500ms linear infinite; + -ms-animation: pace-theme-barber-shop-motion 500ms linear infinite; + -o-animation: pace-theme-barber-shop-motion 500ms linear infinite; + animation: pace-theme-barber-shop-motion 500ms linear infinite; + } + + @-webkit-keyframes pace-theme-barber-shop-motion { + 0% { + -webkit-transform: none; + transform: none; + } + + 100% { + -webkit-transform: translate(-32px, 0); + transform: translate(-32px, 0); + } + } + + @-moz-keyframes pace-theme-barber-shop-motion { + 0% { + -moz-transform: none; + transform: none; + } + + 100% { + -moz-transform: translate(-32px, 0); + transform: translate(-32px, 0); + } + } + + @-o-keyframes pace-theme-barber-shop-motion { + 0% { + -o-transform: none; + transform: none; + } + + 100% { + -o-transform: translate(-32px, 0); + transform: translate(-32px, 0); + } + } + + @-ms-keyframes pace-theme-barber-shop-motion { + 0% { + -ms-transform: none; + transform: none; + } + + 100% { + -ms-transform: translate(-32px, 0); + transform: translate(-32px, 0); + } + } + + @keyframes pace-theme-barber-shop-motion { + 0% { + transform: none; + transform: none; + } + + 100% { + transform: translate(-32px, 0); + transform: translate(-32px, 0); + } + } +} + +// Big counter. +.pace-big_counter { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } + + .pace.pace-inactive .pace-progress { + display: none; + } + + .pace .pace-progress { + position: fixed; + z-index: 2000; + top: 0; + right: 0; + height: 5rem; + width: 5rem; + + -webkit-transform: translate3d(0, 0, 0) !important; + -ms-transform: translate3d(0, 0, 0) !important; + transform: translate3d(0, 0, 0) !important; + } + + .pace .pace-progress:after { + display: block; + position: absolute; + top: 0; + right: .5rem; + content: attr(data-progress-text); + // font-family: "Helvetica Neue", sans-serif; + // font-weight: 100; + font-size: 5rem; + line-height: 1; + text-align: right; + color: $loadingcolor; + } +} + +// Bounce. +.pace-bounce { + .pace { + width: 140px; + height: 300px; + position: fixed; + top: -90px; + right: -20px; + z-index: 2000; + -webkit-transform: scale(0); + -moz-transform: scale(0); + -ms-transform: scale(0); + -o-transform: scale(0); + transform: scale(0); + opacity: 0; + -webkit-transition: all 2s linear 0s; + -moz-transition: all 2s linear 0s; + transition: all 2s linear 0s; + } + + .pace.pace-active { + -webkit-transform: scale(.25); + -moz-transform: scale(.25); + -ms-transform: scale(.25); + -o-transform: scale(.25); + transform: scale(.25); + opacity: 1; + } + + .pace .pace-activity { + width: 140px; + height: 140px; + border-radius: 70px; + background: $loadingcolor; + position: absolute; + top: 0; + z-index: 1911; + -webkit-animation: pace-bounce 1s infinite; + -moz-animation: pace-bounce 1s infinite; + -o-animation: pace-bounce 1s infinite; + -ms-animation: pace-bounce 1s infinite; + animation: pace-bounce 1s infinite; + } + + .pace .pace-progress { + position: absolute; + display: block; + left: 50%; + bottom: 0; + z-index: 1910; + margin-left: -30px; + width: 60px; + height: 75px; + background: rgba(20, 20, 20, .1); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .1); + border-radius: 30px / 40px; + -webkit-transform: scaleY(.3) !important; + -moz-transform: scaleY(.3) !important; + -ms-transform: scaleY(.3) !important; + -o-transform: scaleY(.3) !important; + transform: scaleY(.3) !important; + -webkit-animation: pace-compress .5s infinite alternate; + -moz-animation: pace-compress .5s infinite alternate; + -o-animation: pace-compress .5s infinite alternate; + -ms-animation: pace-compress .5s infinite alternate; + animation: pace-compress .5s infinite alternate; + } + + @-webkit-keyframes pace-bounce { + 0% { + top: 0; + -webkit-animation-timing-function: ease-in; + } + + 40% {} + + 50% { + top: 140px; + height: 140px; + -webkit-animation-timing-function: ease-out; + } + + 55% { + top: 160px; + height: 120px; + border-radius: 70px / 60px; + -webkit-animation-timing-function: ease-in; + } + + 65% { + top: 120px; + height: 140px; + border-radius: 70px; + -webkit-animation-timing-function: ease-out; + } + + 95% { + top: 0; + -webkit-animation-timing-function: ease-in; + } + + 100% { + top: 0; + -webkit-animation-timing-function: ease-in; + } + } + + @-moz-keyframes pace-bounce { + 0% { + top: 0; + -moz-animation-timing-function: ease-in; + } + + 40% {} + + 50% { + top: 140px; + height: 140px; + -moz-animation-timing-function: ease-out; + } + + 55% { + top: 160px; + height: 120px; + border-radius: 70px / 60px; + -moz-animation-timing-function: ease-in; + } + + 65% { + top: 120px; + height: 140px; + border-radius: 70px; + -moz-animation-timing-function: ease-out; + } + + 95% { + top: 0; + -moz-animation-timing-function: ease-in; + } + + 100% { + top: 0; + -moz-animation-timing-function: ease-in; + } + } + + @keyframes pace-bounce { + 0% { + top: 0; + animation-timing-function: ease-in; + } + + 50% { + top: 140px; + height: 140px; + animation-timing-function: ease-out; + } + + 55% { + top: 160px; + height: 120px; + border-radius: 70px / 60px; + animation-timing-function: ease-in; + } + + 65% { + top: 120px; + height: 140px; + border-radius: 70px; + animation-timing-function: ease-out; + } + + 95% { + top: 0; + animation-timing-function: ease-in; + } + + 100% { + top: 0; + animation-timing-function: ease-in; + } + } + + @-webkit-keyframes pace-compress { + 0% { + bottom: 0; + margin-left: -30px; + width: 60px; + height: 75px; + background: rgba(20, 20, 20, .1); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .1); + border-radius: 30px / 40px; + -webkit-animation-timing-function: ease-in; + } + + 100% { + bottom: 30px; + margin-left: -10px; + width: 20px; + height: 5px; + background: rgba(20, 20, 20, .3); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .3); + border-radius: 20px / 20px; + -webkit-animation-timing-function: ease-out; + } + } + + @-moz-keyframes pace-compress { + 0% { + bottom: 0; + margin-left: -30px; + width: 60px; + height: 75px; + background: rgba(20, 20, 20, .1); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .1); + border-radius: 30px / 40px; + -moz-animation-timing-function: ease-in; + } + + 100% { + bottom: 30px; + margin-left: -10px; + width: 20px; + height: 5px; + background: rgba(20, 20, 20, .3); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .3); + border-radius: 20px / 20px; + -moz-animation-timing-function: ease-out; + } + } + + @keyframes pace-compress { + 0% { + bottom: 0; + margin-left: -30px; + width: 60px; + height: 75px; + background: rgba(20, 20, 20, .1); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .1); + border-radius: 30px / 40px; + animation-timing-function: ease-in; + } + + 100% { + bottom: 30px; + margin-left: -10px; + width: 20px; + height: 5px; + background: rgba(20, 20, 20, .3); + box-shadow: 0 0 20px 35px rgba(20, 20, 20, .3); + border-radius: 20px / 20px; + animation-timing-function: ease-out; + } + } +} + +// Center atom. +.pace-center_atom { + .pace.pace-inactive { + display: none; + } + + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + z-index: 2000; + position: fixed; + height: 60px; + width: 100px; + margin: auto; + top: 0; + left: 0; + right: 0; + bottom: 0; + } + + .pace .pace-progress { + z-index: 2000; + position: absolute; + height: 60px; + width: 100px; + + -webkit-transform: translate3d(0, 0, 0) !important; + -ms-transform: translate3d(0, 0, 0) !important; + transform: translate3d(0, 0, 0) !important; + } + + .pace .pace-progress:before { + content: attr(data-progress-text); + text-align: center; + color: #fff; + background: $loadingcolor; + border-radius: 50%; + //font-family: "Helvetica Neue", sans-serif; + font-size: 14px; + font-weight: 100; + line-height: 1; + padding: 12% 0 7px; // 20% 0 7px. + width: 40%; // 50%. + height: 65%; // 40%. + margin: 10px 0 0 30px; + display: block; + z-index: 999; + position: absolute; + } + + .pace .pace-activity { + font-size: 15px; + line-height: 1; + z-index: 2000; + position: absolute; + height: 60px; + width: 100px; + + display: block; + -webkit-animation: pace-theme-center-atom-spin 2s linear infinite; + -moz-animation: pace-theme-center-atom-spin 2s linear infinite; + -o-animation: pace-theme-center-atom-spin 2s linear infinite; + animation: pace-theme-center-atom-spin 2s linear infinite; + } + + .pace .pace-activity { + border-radius: 50%; + border: 5px solid $loadingcolor; + content: ' '; + display: block; + position: absolute; + top: 0; + left: 0; + height: 60px; + width: 100px; + } + + .pace .pace-activity:after { + border-radius: 50%; + border: 5px solid $loadingcolor; + content: ' '; + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 60px; + width: 100px; + + -webkit-transform: rotate(60deg); + -moz-transform: rotate(60deg); + -o-transform: rotate(60deg); + transform: rotate(60deg); + } + + .pace .pace-activity:before { + border-radius: 50%; + border: 5px solid $loadingcolor; + content: ' '; + display: block; + position: absolute; + top: -5px; + left: -5px; + height: 60px; + width: 100px; + + -webkit-transform: rotate(120deg); + -moz-transform: rotate(120deg); + -o-transform: rotate(120deg); + transform: rotate(120deg); + } + + @-webkit-keyframes pace-theme-center-atom-spin { + 0% { + -webkit-transform: rotate(0deg) + } + + 100% { + -webkit-transform: rotate(359deg) + } + } + + @-moz-keyframes pace-theme-center-atom-spin { + 0% { + -moz-transform: rotate(0deg) + } + + 100% { + -moz-transform: rotate(359deg) + } + } + + @-o-keyframes pace-theme-center-atom-spin { + 0% { + -o-transform: rotate(0deg) + } + + 100% { + -o-transform: rotate(359deg) + } + } + + @keyframes pace-theme-center-atom-spin { + 0% { + transform: rotate(0deg) + } + + 100% { + transform: rotate(359deg) + } + } +} + +// Center circle. +.pace-center_circle { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + -webkit-perspective: 12rem; + -moz-perspective: 12rem; + -ms-perspective: 12rem; + -o-perspective: 12rem; + perspective: 12rem; + + z-index: 2000; + position: fixed; + height: 6rem; + width: 6rem; + margin: auto; + top: 0; + left: 0; + right: 0; + bottom: 0; + } + + .pace.pace-inactive .pace-progress { + display: none; + } + + .pace .pace-progress { + position: fixed; + z-index: 2000; + display: block; + position: absolute; + left: 0; + top: 0; + height: 6rem; + width: 6rem !important; + line-height: 6rem; + font-size: 2rem; + border-radius: 50%; + background: $loadingcolor; + color: #fff; + // font-family: "Helvetica Neue", sans-serif; + // font-weight: 100; + text-align: center; + + -webkit-animation: pace-theme-center-circle-spin linear infinite 2s; + -moz-animation: pace-theme-center-circle-spin linear infinite 2s; + -ms-animation: pace-theme-center-circle-spin linear infinite 2s; + -o-animation: pace-theme-center-circle-spin linear infinite 2s; + animation: pace-theme-center-circle-spin linear infinite 2s; + + -webkit-transform-style: preserve-3d; + -moz-transform-style: preserve-3d; + -ms-transform-style: preserve-3d; + -o-transform-style: preserve-3d; + transform-style: preserve-3d; + } + + .pace .pace-progress:after { + content: attr(data-progress-text); + display: block; + } + + @-webkit-keyframes pace-theme-center-circle-spin { + from { + -webkit-transform: rotateY(0deg) + } + + to { + -webkit-transform: rotateY(360deg) + } + } + + @-moz-keyframes pace-theme-center-circle-spin { + from { + -moz-transform: rotateY(0deg) + } + + to { + -moz-transform: rotateY(360deg) + } + } + + @-ms-keyframes pace-theme-center-circle-spin { + from { + -ms-transform: rotateY(0deg) + } + + to { + -ms-transform: rotateY(360deg) + } + } + + @-o-keyframes pace-theme-center-circle-spin { + from { + -o-transform: rotateY(0deg) + } + + to { + -o-transform: rotateY(360deg) + } + } + + @keyframes pace-theme-center-circle-spin { + from { + transform: rotateY(0deg) + } + + to { + transform: rotateY(360deg) + } + } +} + +// Center radar. +.pace-center_radar { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + z-index: 2000; + position: fixed; + height: 90px; + width: 90px; + margin: auto; + top: 0; + left: 0; + right: 0; + bottom: 0; + } + + .pace.pace-inactive .pace-activity { + display: none; + } + + .pace .pace-activity { + position: fixed; + z-index: 2000; + display: block; + position: absolute; + left: -30px; + top: -30px; + height: 90px; + width: 90px; + display: block; + border-width: 30px; + border-style: double; + border-color: $loadingcolor transparent transparent; + border-radius: 50%; + + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + + -webkit-animation: spin 1s linear infinite; + -moz-animation: spin 1s linear infinite; + -o-animation: spin 1s linear infinite; + animation: spin 1s linear infinite; + } + + .pace .pace-activity:before { + content: ' '; + position: absolute; + top: 10px; + left: 10px; + height: 50px; + width: 50px; + display: block; + border-width: 10px; + border-style: solid; + border-color: $loadingcolor transparent transparent; + border-radius: 50%; + + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + } + + @-webkit-keyframes spin { + 100% { + -webkit-transform: rotate(359deg); + } + } + + @-moz-keyframes spin { + 100% { + -moz-transform: rotate(359deg); + } + } + + @-o-keyframes spin { + 100% { + -moz-transform: rotate(359deg); + } + } + + @keyframes spin { + 100% { + transform: rotate(359deg); + } + } +} + +// Center simple. +.pace-center_simple { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + z-index: 2000; + position: fixed; + margin: auto; + top: 0; + left: 0; + right: 0; + bottom: 0; + height: 5px; + width: 200px; + background: #fff; + border: 1px solid $loadingcolor; + + overflow: hidden; + } + + .pace .pace-progress { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; + + -webkit-transform: translate3d(0, 0, 0); + -moz-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + -o-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + + max-width: 200px; + position: fixed; + z-index: 2000; + display: block; + position: absolute; + top: 0; + right: 100%; + height: 100%; + width: 100%; + background: $loadingcolor; + } + + .pace.pace-inactive { + display: none; + } +} + +// Corner indicator. +.pace-corner_indicator { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } + + .pace .pace-activity { + display: block; + position: fixed; + z-index: 2000; + top: 0; + right: 0; + width: 300px; + height: 300px; + background: $loadingcolor; + -webkit-transition: -webkit-transform 0.3s; + transition: transform 0.3s; + -webkit-transform: translateX(100%) translateY(-100%) rotate(45deg); + transform: translateX(100%) translateY(-100%) rotate(45deg); + pointer-events: none; + } + + .pace.pace-active .pace-activity { + -webkit-transform: translateX(50%) translateY(-50%) rotate(45deg); + transform: translateX(50%) translateY(-50%) rotate(45deg); + } + + .pace .pace-activity::before, + .pace .pace-activity::after { + -moz-box-sizing: border-box; + box-sizing: border-box; + position: absolute; + bottom: 30px; + left: 50%; + display: block; + border: 5px solid #fff; + border-radius: 50%; + content: ''; + } + + .pace .pace-activity::before { + margin-left: -40px; + width: 80px; + height: 80px; + border-right-color: rgba(0, 0, 0, .2); + border-left-color: rgba(0, 0, 0, .2); + -webkit-animation: pace-theme-corner-indicator-spin 3s linear infinite; + animation: pace-theme-corner-indicator-spin 3s linear infinite; + } + + .pace .pace-activity::after { + bottom: 50px; + margin-left: -20px; + width: 40px; + height: 40px; + border-top-color: rgba(0, 0, 0, .2); + border-bottom-color: rgba(0, 0, 0, .2); + -webkit-animation: pace-theme-corner-indicator-spin 1s linear infinite; + animation: pace-theme-corner-indicator-spin 1s linear infinite; + } + + @-webkit-keyframes pace-theme-corner-indicator-spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(359deg); + } + } + + @keyframes pace-theme-corner-indicator-spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(359deg); + } + } +} + +// Fill left. +.pace-fill_left { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } + + .pace-inactive { + display: none; + } + + .pace .pace-progress { + background-color: $loadingcolorrgba; + position: fixed; + z-index: 1; // Fix from -1. + top: 0; + right: 100%; + bottom: 0; + width: 100%; + } +} + +// Flash. +.pace-flash { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + } + + .pace-inactive { + display: none; + } + + .pace .pace-progress { + background: $loadingcolor; + position: fixed; + z-index: 2000; + top: 0; + right: 100%; + width: 100%; + height: 2px; + } + + .pace .pace-progress-inner { + display: block; + position: absolute; + right: 0px; + width: 100px; + height: 100%; + box-shadow: 0 0 10px $loadingcolor, 0 0 5px $loadingcolor; + opacity: 1.0; + -webkit-transform: rotate(3deg) translate(0px, -4px); + -moz-transform: rotate(3deg) translate(0px, -4px); + -ms-transform: rotate(3deg) translate(0px, -4px); + -o-transform: rotate(3deg) translate(0px, -4px); + transform: rotate(3deg) translate(0px, -4px); + } + + .pace .pace-activity { + display: block; + position: fixed; + z-index: 2000; + top: 15px; + right: 15px; + width: 14px; + height: 14px; + border: solid 2px transparent; + border-top-color: $loadingcolor; + border-left-color: $loadingcolor; + border-radius: 10px; + -webkit-animation: pace-spinner 400ms linear infinite; + -moz-animation: pace-spinner 400ms linear infinite; + -ms-animation: pace-spinner 400ms linear infinite; + -o-animation: pace-spinner 400ms linear infinite; + animation: pace-spinner 400ms linear infinite; + } + + @-webkit-keyframes pace-spinner { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + @-moz-keyframes pace-spinner { + 0% { + -moz-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -moz-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + @-o-keyframes pace-spinner { + 0% { + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -o-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + @-ms-keyframes pace-spinner { + 0% { + -ms-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -ms-transform: rotate(360deg); + transform: rotate(360deg); + } + } + + @keyframes pace-spinner { + 0% { + transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + transform: rotate(360deg); + } + } +} + +// Flat top. +.pace-flat_top { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + position: fixed; + top: 0; + left: 0; + width: 100%; + + -webkit-transform: translate3d(0, -50px, 0); + -ms-transform: translate3d(0, -50px, 0); + transform: translate3d(0, -50px, 0); + + -webkit-transition: transform .5s ease-out; + -ms-transition: transform .5s ease-out; + transition: transform .5s ease-out; + + z-index: 2000; // Fix. + } + + .pace.pace-active { + -webkit-transform: translate3d(0, 0, 0); + -ms-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } + + .pace .pace-progress { + display: block; + position: fixed; + z-index: 2000; + top: 0; + right: 100%; + width: 100%; + height: 10px; + background: $loadingcolor; + + pointer-events: none; + } +} + +// Loading bar. +.pace-loading_bar { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + + z-index: 2000; + position: fixed; + margin: auto; + top: 12px; + left: 0; + right: 0; + bottom: 0; + width: 200px; + height: 50px; + overflow: hidden; + } + + .pace .pace-progress { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; + + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + + -webkit-background-clip: padding-box; + -moz-background-clip: padding; + background-clip: padding-box; + + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + + display: block; + position: absolute; + right: 100%; + margin-right: -7px; + width: 93%; + top: 7px; + height: 14px; + font-size: 12px; + background: $loadingcolor; + color: $loadingcolor; + line-height: 60px; + // font-weight: bold; + // font-family: Helvetica, Arial, "Lucida Grande", sans-serif; + + -webkit-box-shadow: 120px 0 #fff, 240px 0 #fff; + -ms-box-shadow: 120px 0 #fff, 240px 0 #fff; + box-shadow: 120px 0 #fff, 240px 0 #fff; + } + + .pace .pace-progress:after { + content: attr(data-progress-text); + display: inline-block; + position: fixed; + width: 45px; + text-align: right; + right: 0; + padding-right: 16px; + top: 4px; + } + + .pace .pace-progress[data-progress-text="0%"]:after { + right: -200px + } + + .pace .pace-progress[data-progress-text="1%"]:after { + right: -198.14px + } + + .pace .pace-progress[data-progress-text="2%"]:after { + right: -196.28px + } + + .pace .pace-progress[data-progress-text="3%"]:after { + right: -194.42px + } + + .pace .pace-progress[data-progress-text="4%"]:after { + right: -192.56px + } + + .pace .pace-progress[data-progress-text="5%"]:after { + right: -190.7px + } + + .pace .pace-progress[data-progress-text="6%"]:after { + right: -188.84px + } + + .pace .pace-progress[data-progress-text="7%"]:after { + right: -186.98px + } + + .pace .pace-progress[data-progress-text="8%"]:after { + right: -185.12px + } + + .pace .pace-progress[data-progress-text="9%"]:after { + right: -183.26px + } + + .pace .pace-progress[data-progress-text="10%"]:after { + right: -181.4px + } + + .pace .pace-progress[data-progress-text="11%"]:after { + right: -179.54px + } + + .pace .pace-progress[data-progress-text="12%"]:after { + right: -177.68px + } + + .pace .pace-progress[data-progress-text="13%"]:after { + right: -175.82px + } + + .pace .pace-progress[data-progress-text="14%"]:after { + right: -173.96px + } + + .pace .pace-progress[data-progress-text="15%"]:after { + right: -172.1px + } + + .pace .pace-progress[data-progress-text="16%"]:after { + right: -170.24px + } + + .pace .pace-progress[data-progress-text="17%"]:after { + right: -168.38px + } + + .pace .pace-progress[data-progress-text="18%"]:after { + right: -166.52px + } + + .pace .pace-progress[data-progress-text="19%"]:after { + right: -164.66px + } + + .pace .pace-progress[data-progress-text="20%"]:after { + right: -162.8px + } + + .pace .pace-progress[data-progress-text="21%"]:after { + right: -160.94px + } + + .pace .pace-progress[data-progress-text="22%"]:after { + right: -159.08px + } + + .pace .pace-progress[data-progress-text="23%"]:after { + right: -157.22px + } + + .pace .pace-progress[data-progress-text="24%"]:after { + right: -155.36px + } + + .pace .pace-progress[data-progress-text="25%"]:after { + right: -153.5px + } + + .pace .pace-progress[data-progress-text="26%"]:after { + right: -151.64px + } + + .pace .pace-progress[data-progress-text="27%"]:after { + right: -149.78px + } + + .pace .pace-progress[data-progress-text="28%"]:after { + right: -147.92px + } + + .pace .pace-progress[data-progress-text="29%"]:after { + right: -146.06px + } + + .pace .pace-progress[data-progress-text="30%"]:after { + right: -144.2px + } + + .pace .pace-progress[data-progress-text="31%"]:after { + right: -142.34px + } + + .pace .pace-progress[data-progress-text="32%"]:after { + right: -140.48px + } + + .pace .pace-progress[data-progress-text="33%"]:after { + right: -138.62px + } + + .pace .pace-progress[data-progress-text="34%"]:after { + right: -136.76px + } + + .pace .pace-progress[data-progress-text="35%"]:after { + right: -134.9px + } + + .pace .pace-progress[data-progress-text="36%"]:after { + right: -133.04px + } + + .pace .pace-progress[data-progress-text="37%"]:after { + right: -131.18px + } + + .pace .pace-progress[data-progress-text="38%"]:after { + right: -129.32px + } + + .pace .pace-progress[data-progress-text="39%"]:after { + right: -127.46px + } + + .pace .pace-progress[data-progress-text="40%"]:after { + right: -125.6px + } + + .pace .pace-progress[data-progress-text="41%"]:after { + right: -123.74px + } + + .pace .pace-progress[data-progress-text="42%"]:after { + right: -121.88px + } + + .pace .pace-progress[data-progress-text="43%"]:after { + right: -120.02px + } + + .pace .pace-progress[data-progress-text="44%"]:after { + right: -118.16px + } + + .pace .pace-progress[data-progress-text="45%"]:after { + right: -116.3px + } + + .pace .pace-progress[data-progress-text="46%"]:after { + right: -114.44px + } + + .pace .pace-progress[data-progress-text="47%"]:after { + right: -112.58px + } + + .pace .pace-progress[data-progress-text="48%"]:after { + right: -110.72px + } + + .pace .pace-progress[data-progress-text="49%"]:after { + right: -108.86px + } + + .pace .pace-progress[data-progress-text="50%"]:after { + right: -107px + } + + .pace .pace-progress[data-progress-text="51%"]:after { + right: -105.14px + } + + .pace .pace-progress[data-progress-text="52%"]:after { + right: -103.28px + } + + .pace .pace-progress[data-progress-text="53%"]:after { + right: -101.42px + } + + .pace .pace-progress[data-progress-text="54%"]:after { + right: -99.56px + } + + .pace .pace-progress[data-progress-text="55%"]:after { + right: -97.7px + } + + .pace .pace-progress[data-progress-text="56%"]:after { + right: -95.84px + } + + .pace .pace-progress[data-progress-text="57%"]:after { + right: -93.98px + } + + .pace .pace-progress[data-progress-text="58%"]:after { + right: -92.12px + } + + .pace .pace-progress[data-progress-text="59%"]:after { + right: -90.26px + } + + .pace .pace-progress[data-progress-text="60%"]:after { + right: -88.4px + } + + .pace .pace-progress[data-progress-text="61%"]:after { + right: -86.53999999999999px + } + + .pace .pace-progress[data-progress-text="62%"]:after { + right: -84.68px + } + + .pace .pace-progress[data-progress-text="63%"]:after { + right: -82.82px + } + + .pace .pace-progress[data-progress-text="64%"]:after { + right: -80.96000000000001px + } + + .pace .pace-progress[data-progress-text="65%"]:after { + right: -79.1px + } + + .pace .pace-progress[data-progress-text="66%"]:after { + right: -77.24px + } + + .pace .pace-progress[data-progress-text="67%"]:after { + right: -75.38px + } + + .pace .pace-progress[data-progress-text="68%"]:after { + right: -73.52px + } + + .pace .pace-progress[data-progress-text="69%"]:after { + right: -71.66px + } + + .pace .pace-progress[data-progress-text="70%"]:after { + right: -69.8px + } + + .pace .pace-progress[data-progress-text="71%"]:after { + right: -67.94px + } + + .pace .pace-progress[data-progress-text="72%"]:after { + right: -66.08px + } + + .pace .pace-progress[data-progress-text="73%"]:after { + right: -64.22px + } + + .pace .pace-progress[data-progress-text="74%"]:after { + right: -62.36px + } + + .pace .pace-progress[data-progress-text="75%"]:after { + right: -60.5px + } + + .pace .pace-progress[data-progress-text="76%"]:after { + right: -58.64px + } + + .pace .pace-progress[data-progress-text="77%"]:after { + right: -56.78px + } + + .pace .pace-progress[data-progress-text="78%"]:after { + right: -54.92px + } + + .pace .pace-progress[data-progress-text="79%"]:after { + right: -53.06px + } + + .pace .pace-progress[data-progress-text="80%"]:after { + right: -51.2px + } + + .pace .pace-progress[data-progress-text="81%"]:after { + right: -49.34px + } + + .pace .pace-progress[data-progress-text="82%"]:after { + right: -47.480000000000004px + } + + .pace .pace-progress[data-progress-text="83%"]:after { + right: -45.62px + } + + .pace .pace-progress[data-progress-text="84%"]:after { + right: -43.76px + } + + .pace .pace-progress[data-progress-text="85%"]:after { + right: -41.9px + } + + .pace .pace-progress[data-progress-text="86%"]:after { + right: -40.04px + } + + .pace .pace-progress[data-progress-text="87%"]:after { + right: -38.18px + } + + .pace .pace-progress[data-progress-text="88%"]:after { + right: -36.32px + } + + .pace .pace-progress[data-progress-text="89%"]:after { + right: -34.46px + } + + .pace .pace-progress[data-progress-text="90%"]:after { + right: -32.6px + } + + .pace .pace-progress[data-progress-text="91%"]:after { + right: -30.740000000000002px + } + + .pace .pace-progress[data-progress-text="92%"]:after { + right: -28.880000000000003px + } + + .pace .pace-progress[data-progress-text="93%"]:after { + right: -27.02px + } + + .pace .pace-progress[data-progress-text="94%"]:after { + right: -25.16px + } + + .pace .pace-progress[data-progress-text="95%"]:after { + right: -23.3px + } + + .pace .pace-progress[data-progress-text="96%"]:after { + right: -21.439999999999998px + } + + .pace .pace-progress[data-progress-text="97%"]:after { + right: -19.58px + } + + .pace .pace-progress[data-progress-text="98%"]:after { + right: -17.72px + } + + .pace .pace-progress[data-progress-text="99%"]:after { + right: -15.86px + } + + .pace .pace-progress[data-progress-text="100%"]:after { + right: -14px + } + + + .pace .pace-activity { + position: absolute; + width: 100%; + height: 28px; + z-index: 2001; + box-shadow: inset 0 0 0 2px $loadingcolor, inset 0 0 0 7px #FFF; + border-radius: 10px; + } + + .pace.pace-inactive { + display: none; + } +} + +.pace-mac_osx { + .pace { + -webkit-pointer-events: none; + pointer-events: none; + + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + + overflow: hidden; + position: fixed; + top: 0; + left: 0; + z-index: 2000; + width: 100%; + height: 12px; + background: transparent; // Fix from #fff. + } + + .pace-inactive { + display: none; + } + + $loadingcolordark: darken($loadingcolor, 12%); // #0087E1 to #00558F. + + .pace .pace-progress { + background-color: $loadingcolor; + position: fixed; + top: 0; + right: 100%; + width: 100%; + height: 12px; + overflow: hidden; + + -webkit-border-radius: 0 0 4px 0; + -moz-border-radius: 0 0 4px 0; + -o-border-radius: 0 0 4px 0; + border-radius: 0 0 4px 0; + + -webkit-box-shadow: inset -1px 0 $loadingcolordark, inset 0 -1px $loadingcolordark, inset 0 2px rgba(255, 255, 255, 0.5), inset 0 6px rgba(255, 255, 255, .3); + -moz-box-shadow: inset -1px 0 $loadingcolordark, inset 0 -1px $loadingcolordark, inset 0 2px rgba(255, 255, 255, 0.5), inset 0 6px rgba(255, 255, 255, .3); + -o-box-shadow: inset -1px 0 $loadingcolordark, inset 0 -1px $loadingcolordark, inset 0 2px rgba(255, 255, 255, 0.5), inset 0 6px rgba(255, 255, 255, .3); + box-shadow: inset -1px 0 $loadingcolordark, inset 0 -1px $loadingcolordark, inset 0 2px rgba(255, 255, 255, 0.5), inset 0 6px rgba(255, 255, 255, .3); + } + + .pace .pace-activity { + position: fixed; + top: 0; + left: 0; + right: -28px; + bottom: 0; + height: 12px; // Fix. + + -webkit-background-image: radial-gradient(rgba(255, 255, 255, .65) 0%, rgba(255, 255, 255, .15) 100%); + -moz-background-image: radial-gradient(rgba(255, 255, 255, .65) 0%, rgba(255, 255, 255, .15) 100%); + -o-background-image: radial-gradient(rgba(255, 255, 255, .65) 0%, rgba(255, 255, 255, .15) 100%); + background-image: radial-gradient(rgba(255, 255, 255, .65) 0%, rgba(255, 255, 255, .15) 100%); + + -webkit-background-size: 28px 100%; + -moz-background-size: 28px 100%; + -o-background-size: 28px 100%; + background-size: 28px 100%; + + -webkit-animation: pace-theme-mac-osx-motion 500ms linear infinite; + -moz-animation: pace-theme-mac-osx-motion 500ms linear infinite; + -ms-animation: pace-theme-mac-osx-motion 500ms linear infinite; + -o-animation: pace-theme-mac-osx-motion 500ms linear infinite; + animation: pace-theme-mac-osx-motion 500ms linear infinite; + } + + @-webkit-keyframes pace-theme-mac-osx-motion { + 0% { + -webkit-transform: none; + transform: none; + } + + 100% { + -webkit-transform: translate(-28px, 0); + transform: translate(-28px, 0); + } + } + + @-moz-keyframes pace-theme-mac-osx-motion { + 0% { + -moz-transform: none; + transform: none; + } + + 100% { + -moz-transform: translate(-28px, 0); + transform: translate(-28px, 0); + } + } + + @-o-keyframes pace-theme-mac-osx-motion { + 0% { + -o-transform: none; + transform: none; + } + + 100% { + -o-transform: translate(-28px, 0); + transform: translate(-28px, 0); + } + } + + @-ms-keyframes pace-theme-mac-osx-motion { + 0% { + -ms-transform: none; + transform: none; + } + + 100% { + -ms-transform: translate(-28px, 0); + transform: translate(-28px, 0); + } + } + + @keyframes pace-theme-mac-osx-motion { + 0% { + transform: none; + transform: none; + } + + 100% { + transform: translate(-28px, 0); + transform: translate(-28px, 0); + } + } +} \ No newline at end of file diff --git a/scss/settings/adaptable.scss b/scss/settings/adaptable.scss index f8232ab..70b466d 100644 --- a/scss/settings/adaptable.scss +++ b/scss/settings/adaptable.scss @@ -1361,28 +1361,6 @@ a.cimbox { text-align: center; } -// Pace Settings. -.pace { - pointer-events: none; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; -} - -.pace-inactive { - display: none; -} - -.pace .pace-progress { - background-color: [[setting:loadingcolor]]; - height: 2px; - position: fixed; - top: 0; - right: 100%; - width: 100%; - z-index: 2000; -} - // Hidden admin blocks. .hidden-blocks .block { float: right; diff --git a/settings.php b/settings.php index 7cf195e..000c0f3 100644 --- a/settings.php +++ b/settings.php @@ -47,18 +47,22 @@ include(dirname(__FILE__) . '/settings/information.php'); include(dirname(__FILE__) . '/settings/alerts.php'); include(dirname(__FILE__) . '/settings/analytics.php'); - include(dirname(__FILE__) . '/settings/block_regions.php'); include(dirname(__FILE__) . '/settings/block_settings.php'); include(dirname(__FILE__) . '/settings/buttons.php'); include(dirname(__FILE__) . '/settings/category_headers.php'); include(dirname(__FILE__) . '/settings/colors.php'); include(dirname(__FILE__) . '/settings/courses.php'); include(dirname(__FILE__) . '/settings/course_index.php'); + include(dirname(__FILE__) . '/settings/custom_css.php'); + include(dirname(__FILE__) . '/settings/custom_js.php'); + include(dirname(__FILE__) . '/settings/custom_menus.php'); include(dirname(__FILE__) . '/settings/dash_block_regions.php'); include(dirname(__FILE__) . '/settings/fonts.php'); include(dirname(__FILE__) . '/settings/footer.php'); include(dirname(__FILE__) . '/settings/frontpage_courses.php'); + include(dirname(__FILE__) . '/settings/frontpage_block_regions.php'); include(dirname(__FILE__) . '/settings/frontpage_slider.php'); + include(dirname(__FILE__) . '/settings/general.php'); include(dirname(__FILE__) . '/settings/header.php'); include(dirname(__FILE__) . '/settings/header_menus.php'); include(dirname(__FILE__) . '/settings/header_social.php'); @@ -77,9 +81,6 @@ include(dirname(__FILE__) . '/settings/print.php'); include(dirname(__FILE__) . '/settings/templates.php'); include(dirname(__FILE__) . '/settings/user.php'); - include(dirname(__FILE__) . '/settings/custom_css.php'); - include(dirname(__FILE__) . '/settings/custom_js.php'); - include(dirname(__FILE__) . '/settings/custom_menus.php'); } $ADMIN->add('theme_adaptable', $asettings); require(dirname(__FILE__) . '/settings/importexport_settings.php'); diff --git a/settings/block_settings.php b/settings/block_settings.php index 3844cfc..700196d 100644 --- a/settings/block_settings.php +++ b/settings/block_settings.php @@ -29,9 +29,9 @@ $page = new \theme_adaptable\admin_settingspage('theme_adaptable_blocks', get_string('settingspageblocksettings', 'theme_adaptable')); - // General. - $name = 'theme_adaptable/settingsblocksgeneral'; - $heading = get_string('settingsblocksgeneral', 'theme_adaptable'); + // Configuration. + $name = 'theme_adaptable/settingsblocksconfiguration'; + $heading = get_string('settingsblocksconfiguration', 'theme_adaptable'); $setting = new admin_setting_heading($name, $heading, ''); $page->add($setting); diff --git a/settings/colors.php b/settings/colors.php index 2daa1af..4d9d6a3 100644 --- a/settings/colors.php +++ b/settings/colors.php @@ -159,15 +159,6 @@ $setting = new admin_setting_heading($name, $heading, ''); $page->add($setting); - // Loading bar color. - $name = 'theme_adaptable/loadingcolor'; - $title = get_string('loadingcolor', 'theme_adaptable'); - $description = get_string('loadingcolordesc', 'theme_adaptable'); - $previewconfig = null; - $setting = new admin_setting_configcolourpicker($name, $title, $description, '#00B3A1', $previewconfig); - $setting->set_updatedcallback('theme_reset_all_caches'); - $page->add($setting); - // Top header message badge background color. $name = 'theme_adaptable/msgbadgecolor'; $title = get_string('msgbadgecolor', 'theme_adaptable'); diff --git a/settings/custom_menus.php b/settings/custom_menus.php index 125bd80..61ae0f3 100644 --- a/settings/custom_menus.php +++ b/settings/custom_menus.php @@ -60,29 +60,33 @@ format_text(get_string('headernavbarcustommenucoreheadingdesc', 'theme_adaptable'), FORMAT_MARKDOWN) )); - $page->add(new admin_setting_configtextarea( - 'custommenuitems', + $custommenuitems = get_config('core', 'custommenuitems'); + if (empty($custommenuitems)) { + $custommenuitems = get_string('headernavbarcustommenucoreempty', 'theme_adaptable', 'custommenuitems'); + } else { + $custommenuitems = get_string('headernavbarcustommenucorenotempty', 'theme_adaptable', 'custommenuitems') . + '' . nl2br($custommenuitems) . ''; + } + $page->add(new admin_setting_description( + 'theme_adaptable/custommenuitems', new lang_string('custommenuitems', 'admin'), - get_string('custommenuitemscoredesc', 'theme_adaptable').'

'. - get_string('fontawesomesettingdesc', 'theme_adaptable'), - '', - PARAM_RAW, - '50', - '10' + $custommenuitems.'

'. + get_string('custommenuitemscoredesc', 'theme_adaptable').'
'. + get_string('fontawesomesettingdesc', 'theme_adaptable') )); - $defaultsettingcustomusermenuitems = [ - 'messages,message|/message/index.php|fa-regular fa-comment', - 'privatefiles,moodle|/user/files.php|folder-tree', - ]; - $page->add(new admin_setting_configtextarea( - 'customusermenuitems', + $customusermenuitems = get_config('core', 'customusermenuitems'); + if (empty($customusermenuitems)) { + $customusermenuitems = get_string('headernavbarcustommenucoreempty', 'theme_adaptable', 'customusermenuitems'); + } else { + $customusermenuitems = get_string('headernavbarcustommenucorenotempty', 'theme_adaptable', 'customusermenuitems') . + '' . nl2br($customusermenuitems) . ''; + } + $page->add(new admin_setting_description( + 'theme_adaptable/customusermenuitems', new lang_string('customusermenuitems', 'admin'), - new lang_string('customusermenuitemscoredesc', 'theme_adaptable'), - implode("\n", $defaultsettingcustomusermenuitems), - PARAM_RAW, - '50', - '10' + $customusermenuitems.'

'. + get_string('customusermenuitemscoredesc', 'theme_adaptable') )); $asettings->add($page); diff --git a/settings/block_regions.php b/settings/frontpage_block_regions.php similarity index 97% rename from settings/block_regions.php rename to settings/frontpage_block_regions.php index b9bc81c..78e3c78 100644 --- a/settings/block_regions.php +++ b/settings/frontpage_block_regions.php @@ -29,7 +29,7 @@ if ($ADMIN->fulltree) { $page = new \theme_adaptable\admin_settingspage( 'theme_adaptable_frontpage_block_regions', - get_string('frontpageblockregionsettings', 'theme_adaptable') + get_string('settingspagefrontpageblockregionsettings', 'theme_adaptable') ); $page->add(new admin_setting_heading( diff --git a/settings/general.php b/settings/general.php new file mode 100644 index 0000000..aa3e75d --- /dev/null +++ b/settings/general.php @@ -0,0 +1,74 @@ +. + +/** + * General + * + * @package theme_adaptable + * @copyright 2024 G J Barnard + * {@link https://moodle.org/user/profile.php?id=442195} + * {@link https://gjbarnard.co.uk} + * @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later. + */ + +defined('MOODLE_INTERNAL') || die; + +// General settings. +if ($ADMIN->fulltree) { + $page = new \theme_adaptable\admin_settingspage( + 'theme_adaptable_general', + get_string('settingspagegeneralsettings', 'theme_adaptable') + ); + + $name = 'theme_adaptable/pageloadingprogress'; + $title = get_string('pageloadingprogress', 'theme_adaptable'); + $description = get_string('pageloadingprogressdesc', 'theme_adaptable'); + $setting = new admin_setting_configcheckbox($name, $title, $description, true); + $page->add($setting); + + $name = 'theme_adaptable/pageloadingprogresstheme'; + $title = get_string('pageloadingprogresstheme', 'theme_adaptable'); + $description = get_string('pageloadingprogressthemedesc', 'theme_adaptable'); + $choices = [ + 'minimal' => get_string('pageloadingprogressthememinimal', 'theme_adaptable'), + 'barber_shop' => get_string('pageloadingprogressthemebarbershop', 'theme_adaptable'), + 'big_counter' => get_string('pageloadingprogressthemebigcounter', 'theme_adaptable'), + 'bounce' => get_string('pageloadingprogressthemebounce', 'theme_adaptable'), + 'center_atom' => get_string('pageloadingprogressthemecenteratom', 'theme_adaptable'), + 'center_circle' => get_string('pageloadingprogressthemecentercircle', 'theme_adaptable'), + 'center_radar' => get_string('pageloadingprogressthemecenterradar', 'theme_adaptable'), + 'center_simple' => get_string('pageloadingprogressthemecentersimple', 'theme_adaptable'), + 'corner_indicator' => get_string('pageloadingprogressthemecornerindicator', 'theme_adaptable'), + 'fill_left' => get_string('pageloadingprogressthemefillleft', 'theme_adaptable'), + 'flash' => get_string('pageloadingprogressthemeflash', 'theme_adaptable'), + 'flat_top' => get_string('pageloadingprogressthemeflattop', 'theme_adaptable'), + 'loading_bar' => get_string('pageloadingprogressthemeloadingbar', 'theme_adaptable'), + 'mac_osx' => get_string('pageloadingprogressthememacosx', 'theme_adaptable'), + ]; + $setting = new admin_setting_configselect($name, $title, $description, 'minimal', $choices); + $page->add($setting); + + // Loading bar color. + $name = 'theme_adaptable/loadingcolor'; + $title = get_string('loadingcolor', 'theme_adaptable'); + $description = get_string('loadingcolordesc', 'theme_adaptable'); + $previewconfig = null; + $setting = new admin_setting_configcolourpicker($name, $title, $description, '#00B3A1', $previewconfig); + $setting->set_updatedcallback('theme_reset_all_caches'); + $page->add($setting); + + $asettings->add($page); +} diff --git a/settings/news_ticker.php b/settings/news_ticker.php index b78d285..fea286c 100644 --- a/settings/news_ticker.php +++ b/settings/news_ticker.php @@ -104,7 +104,7 @@ $name = 'theme_adaptable/newstickercount'; $title = get_string('newstickercount', 'theme_adaptable'); $description = get_string('newstickercountdesc', 'theme_adaptable'); - $default = THEME_ADAPTABLE_DEFAULT_TOOLSMENUSCOUNT; + $default = THEME_ADAPTABLE_DEFAULT_NEWSTICKERCOUNT; $setting = new admin_setting_configselect($name, $title, $description, $default, $choices0to12); $page->add($setting); diff --git a/tests/behat/behat_theme_adaptable_behat_navigation.php b/tests/behat/behat_theme_adaptable_behat_navigation.php index 3bdb2d3..dbfd8e0 100644 --- a/tests/behat/behat_theme_adaptable_behat_navigation.php +++ b/tests/behat/behat_theme_adaptable_behat_navigation.php @@ -74,7 +74,7 @@ public function i_follow_asset_link($assettitle) { * * This can be used on front page, course, category or modules pages. * - * @override /^I navigate to "(?P(?:[^"]|\\")*)" in current page administration$/ + * @Given /^I navigate to "(?P(?:[^"]|\\")*)" in current page administration$/ * * @throws ExpectationException * @param string $nodetext navigation node to click, may contain path, for example "Reports > Overview" @@ -170,7 +170,7 @@ public function i_navigate_to_in_site_administration($nodetext) { /** * Click on an entry in the user menu. - * @override /^I follow "(?P(?:[^"]|\\")*)" in the user menu$/ + * @Given /^I follow "(?P(?:[^"]|\\")*)" in the user menu$/ * * @param string $nodetext */ diff --git a/tests/behat/behat_theme_adaptable_behat_permissions.php b/tests/behat/behat_theme_adaptable_behat_permissions.php index 9bcf321..bc863e4 100644 --- a/tests/behat/behat_theme_adaptable_behat_permissions.php +++ b/tests/behat/behat_theme_adaptable_behat_permissions.php @@ -43,7 +43,7 @@ class behat_theme_adaptable_behat_permissions extends behat_permissions { /** * Set system level permissions to the specified role. Expects a table with capability name * and permission (Inherit/Allow/Prevent/Prohibit) columns. - * @override /^I set the following system permissions of "(?P(?:[^"]|\\")*)" role:$/ + * @Given /^I set the following system permissions of "(?P(?:[^"]|\\")*)" role:$/ * @param string $rolename * @param TableNode $table */ @@ -93,6 +93,7 @@ public function i_set_the_following_system_permissions_of_role($rolename, $table $systemcontext->mark_dirty(); accesslib_clear_role_cache($roleid); } + /** * Overrides system capabilities at category, course and module levels. * This step begins after clicking 'Permissions' link. Expects a table with capability name diff --git a/version.php b/version.php index 2367734..4cdd63d 100644 --- a/version.php +++ b/version.php @@ -33,17 +33,17 @@ $plugin->component = 'theme_adaptable'; // Adaptable version date (YYYYMMDDrr where rr is the release number). -$plugin->version = 2024100500; +$plugin->version = 2024100501; $plugin->requires = 2024100700.00; // 4.5 (Build: 20241007). $plugin->supported = [405, 405]; // Adaptable version using SemVer (https://semver.org). -$plugin->release = '405.0.1'; +$plugin->release = '405.1.0'; // Adaptable maturity (do not use ALPHA or BETA versions in production sites). -$plugin->maturity = MATURITY_RC; +$plugin->maturity = MATURITY_STABLE; // Adaptable dependencies (Only Boost as it's the parent theme). $plugin->dependencies = [