diff --git a/assets-src/styles/sass/40-layouts/_sidebar.scss b/assets-src/styles/sass/40-layouts/_sidebar.scss index c83acd66..d330e81d 100644 --- a/assets-src/styles/sass/40-layouts/_sidebar.scss +++ b/assets-src/styles/sass/40-layouts/_sidebar.scss @@ -75,4 +75,4 @@ a viewport media query. .l-sidebar .sidebar--compact { flex-basis: rem(180); -} \ No newline at end of file +} diff --git a/assets-src/styles/sass/50-core-components/_hero.scss b/assets-src/styles/sass/50-core-components/_hero.scss index addf5d9a..21dd9a24 100644 --- a/assets-src/styles/sass/50-core-components/_hero.scss +++ b/assets-src/styles/sass/50-core-components/_hero.scss @@ -83,6 +83,7 @@ > div { align-items: flex-start; + > fieldset, > .input-group-wrap { align-self: end; } diff --git a/assets-src/styles/sass/50-core-components/_members-grid.scss b/assets-src/styles/sass/50-core-components/_members-grid.scss index 4a0723ed..3801609f 100644 --- a/assets-src/styles/sass/50-core-components/_members-grid.scss +++ b/assets-src/styles/sass/50-core-components/_members-grid.scss @@ -61,6 +61,7 @@ .component--members__cta > * { align-items: center; + margin-top: 1em; } .component--members__cta > * > *:not(a) { @@ -69,4 +70,4 @@ @include mq($bp-tab-small) { flex-basis: auto; } -} \ No newline at end of file +} diff --git a/assets-src/styles/sass/50-core-components/_translations.scss b/assets-src/styles/sass/50-core-components/_translations.scss index 263a2744..f1381993 100644 --- a/assets-src/styles/sass/50-core-components/_translations.scss +++ b/assets-src/styles/sass/50-core-components/_translations.scss @@ -8,6 +8,7 @@ } .translations .l-sidebar > * { + align-items: center; margin-bottom: 0; margin-top: 0; } @@ -75,4 +76,4 @@ + * { margin-top: 2em; } -} \ No newline at end of file +} diff --git a/public/dist/assets/js/comments.js b/public/dist/assets/js/comments.js index 69e6a559..db447863 100644 --- a/public/dist/assets/js/comments.js +++ b/public/dist/assets/js/comments.js @@ -9,7 +9,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "translate": () => (/* binding */ translate) /* harmony export */ }); -var translate = { +const translate = { 'translations': { //microcopy translations 'ar': { @@ -188,8 +188,8 @@ var translate = { //languageCode = code of the target language //injection = object of values to inject into the string if interpolation is required, object keys should match references in the translations snippets, // e.g. 'Slide {x} of {y} requires an object with keys x and y. - 'translate': function translate(snippetReference, languageCode) { - var injections = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + 'translate': function (snippetReference, languageCode) { + let injections = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; //without a snippet reference, we don't know what to translate if (snippetReference === undefined || snippetReference === null || snippetReference.length < 1) { return; @@ -279,17 +279,17 @@ __webpack_require__.r(__webpack_exports__); /** * Replaces comment dates with their equivalent time difference (xx hours/days ago) */ -var commentsTimeDiff = function () { +let commentsTimeDiff = function () { document.querySelectorAll(".comment__author time").forEach(function (time) { time.setAttribute('title', time.innerHTML.trim()); - var date = new Date(time.getAttribute("datetime")); - var deltaSeconds = Math.round((date.getTime() - Date.now()) / 1000); - var deltaMinutes = Math.round(deltaSeconds / 60); - var deltaHours = Math.round(deltaSeconds / (60 * 60)); - var deltaDays = Math.round(deltaSeconds / (60 * 60 * 24)); - var deltaMonths = Math.round(deltaSeconds / (60 * 60 * 24 * 30)); - var deltaYears = Math.round(deltaSeconds / (60 * 60 * 24 * 365)); - var formatter = new Intl.RelativeTimeFormat(document.documentElement.lang, { + const date = new Date(time.getAttribute("datetime")); + const deltaSeconds = Math.round((date.getTime() - Date.now()) / 1000); + const deltaMinutes = Math.round(deltaSeconds / 60); + const deltaHours = Math.round(deltaSeconds / (60 * 60)); + const deltaDays = Math.round(deltaSeconds / (60 * 60 * 24)); + const deltaMonths = Math.round(deltaSeconds / (60 * 60 * 24 * 30)); + const deltaYears = Math.round(deltaSeconds / (60 * 60 * 24 * 365)); + const formatter = new Intl.RelativeTimeFormat(document.documentElement.lang, { numeric: "auto" }); if (deltaYears != 0) { @@ -314,32 +314,32 @@ var commentsTimeDiff = function () { window.addComment = function (window) { // Avoid scope lookups on commonly used variables. - var document = window.document; - var commentReplyTitle = document.querySelector('[data-title="reply"]'); + let document = window.document; + let commentReplyTitle = document.querySelector('[data-title="reply"]'); if (!commentReplyTitle) { return; } - var origReplyTitle = commentReplyTitle.textContent; - var commentForm = document.getElementById('comment-form'); + let origReplyTitle = commentReplyTitle.textContent; + let commentForm = document.getElementById('comment-form'); // I18N - var cancelText = _main_translations__WEBPACK_IMPORTED_MODULE_0__.translate.translate('cancelReply', document.documentElement.lang); + let cancelText = _main_translations__WEBPACK_IMPORTED_MODULE_0__.translate.translate('cancelReply', document.documentElement.lang); function changeLinksToBtns() { - var linksArray = Array.prototype.slice.call(document.querySelectorAll('[data-replylink]')); + let linksArray = Array.prototype.slice.call(document.querySelectorAll('[data-replylink]')); linksArray.forEach(function (link) { - var attributes = link.dataset; - var btn = document.createElement('button'); + let attributes = link.dataset; + let btn = document.createElement('button'); btn.setAttribute('class', 'button button--ghost'); btn.innerHTML = link.innerHTML; - for (var key in attributes) { + for (let key in attributes) { btn.setAttribute('data-' + key, attributes[key]); } link.parentNode.replaceChild(btn, link); }); } function addPlaceHolder(respondElement) { - var temporaryFormId = 'js-temp-form-div'; - var temporaryElement = document.getElementById(temporaryFormId); + let temporaryFormId = 'js-temp-form-div'; + let temporaryElement = document.getElementById(temporaryFormId); if (temporaryElement) { // The element already exists, no need to recreate. return; @@ -350,13 +350,13 @@ window.addComment = function (window) { respondElement.parentNode.insertBefore(temporaryElement, respondElement); } function addCancelBtn(respondElement) { - var cancelBtnId = 'js-cancel-reply'; - var cancelBtn = document.getElementById(cancelBtnId); + let cancelBtnId = 'js-cancel-reply'; + let cancelBtn = document.getElementById(cancelBtnId); if (cancelBtn) { cancelBtn.style.display = ''; return; } - var targetDiv = respondElement.querySelector('div'); + let targetDiv = respondElement.querySelector('div'); cancelBtn = document.createElement('button'); cancelBtn.setAttribute('id', cancelBtnId); cancelBtn.setAttribute('class', 'button button--ghost'); @@ -364,11 +364,11 @@ window.addComment = function (window) { targetDiv.appendChild(cancelBtn); } function moveForm(addBelowId, commentId) { - var addBelowElement = document.getElementById(addBelowId); - var respondElement = document.querySelector('[data-respondelement]'); + let addBelowElement = document.getElementById(addBelowId); + let respondElement = document.querySelector('[data-respondelement]'); // Get the hidden fields - var parentIdField = commentForm.querySelector('input[name="parent"]'); + let parentIdField = commentForm.querySelector('input[name="parent"]'); parentIdField.value = commentId; addPlaceHolder(respondElement); addCancelBtn(respondElement); @@ -383,19 +383,19 @@ window.addComment = function (window) { commentForm.querySelector('[type="submit"]').nextElementSibling.style.display = 'none'; document.addEventListener('click', function (event) { if (event.target.matches('[data-replylink]')) { - var replyLink = event.target; - var newReplyTitle = replyLink.getAttribute('data-replyto'); - var commentId = replyLink.getAttribute('data-belowelement'); - var parentId = replyLink.getAttribute('data-commentid'); - var postId = replyLink.getAttribute('data-postid'); + let replyLink = event.target; + let newReplyTitle = replyLink.getAttribute('data-replyto'); + let commentId = replyLink.getAttribute('data-belowelement'); + let parentId = replyLink.getAttribute('data-commentid'); + let postId = replyLink.getAttribute('data-postid'); if (!commentId || !parentId || !postId) return; event.preventDefault(); commentReplyTitle.textContent = newReplyTitle; moveForm(commentId, parentId, postId); } if (event.target.matches('#js-cancel-reply')) { - var temporaryElement = document.getElementById('js-temp-form-div'); - var respondElement = document.querySelector('[data-respondelement]'); + let temporaryElement = document.getElementById('js-temp-form-div'); + let respondElement = document.querySelector('[data-respondelement]'); commentReplyTitle.textContent = origReplyTitle; temporaryElement.parentNode.replaceChild(respondElement, temporaryElement); respondElement.querySelector('input[name="parent"]').value = ''; diff --git a/public/dist/assets/js/comments.min.js b/public/dist/assets/js/comments.min.js index 404450f5..13c74647 100644 --- a/public/dist/assets/js/comments.min.js +++ b/public/dist/assets/js/comments.min.js @@ -1 +1 @@ -(()=>{"use strict";var e={3:(e,t,n)=>{n.r(t),n.d(t,{translate:()=>i});var i={translations:{ar:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},de:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},en:{admin:"Admin",backToMainMenu:"Back to main menu",cancelReply:"Cancel reply",controlsDescription:"carousel controls","logged-in":"logged in",logout:"Logout","member-site":"Member site",menu:"Menu","my-account":"My account","my-calendar":"My calendar","my-organization":"My organization",nextSlide:"next slide",previousSlide:"previous slide","sign-in":"Sign in",sliderDescription:"carousel",slideText:"Slide {x} of {y}","team-site":"Team site"},es:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},fr:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-organization":"__my_organization","my-calendar":"__my-calendar",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},hu:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},ja:{admin:"アドミン",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"ログアウト","member-site":"メンバーサイト",menu:"__menu","my-account":"アカウント","my-calendar":"カレンダー","my-organization":"組織",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"ログイン",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"チームサイト"},"pt-br":{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},"zh-hans":{admin:"管理",backToMainMenu:"返回主目录",cancelReply:"取消回复",controlsDescription:"轮播图控件","logged-in":"已登陆",logout:"退出登陆","member-site":"会员页面",menu:"目录","my-account":"我的账号","my-calendar":"我的日历","my-organization":"我所在的组织",nextSlide:"下一页",previousSlide:"上一页","sign-in":"登陆",sliderDescription:"轮播图",slideText:"第{x}/{y}页","team-site":"员工页面"}},translate:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(null==e||e.length<1)){null!=t&&void 0!==this.translations[t]||(t="en");var i=this.translations[t][e],o=Object.keys(n);if(o.length>0)for(var a=0;a{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{n.r(i);var e=n(3);document.querySelectorAll(".comment__author time").forEach((function(e){e.setAttribute("title",e.innerHTML.trim());var t=new Date(e.getAttribute("datetime")),n=Math.round((t.getTime()-Date.now())/1e3),i=Math.round(n/60),o=Math.round(n/3600),a=Math.round(n/86400),r=Math.round(n/2592e3),l=Math.round(n/31536e3),_=new Intl.RelativeTimeFormat(document.documentElement.lang,{numeric:"auto"});e.innerHTML=0!=l?_.format(l,"years"):0!=r?_.format(r,"months"):0!=a?_.format(a,"days"):0!=o?_.format(o,"hours"):0!=i?_.format(i,"minutes"):_.format(n,"seconds")})),window.addComment=function(t){var n=t.document,i=n.querySelector('[data-title="reply"]');if(i){var o=i.textContent,a=n.getElementById("comment-form"),r=e.translate.translate("cancelReply",n.documentElement.lang);"interactive"===n.readyState&&(Array.prototype.slice.call(n.querySelectorAll("[data-replylink]")).forEach((function(e){var t=e.dataset,i=n.createElement("button");for(var o in i.setAttribute("class","button button--ghost"),i.innerHTML=e.innerHTML,t)i.setAttribute("data-"+o,t[o]);e.parentNode.replaceChild(i,e)})),a.querySelector('[type="submit"]').nextElementSibling.style.display="none",n.addEventListener("click",(function(e){if(e.target.matches("[data-replylink]")){var t=e.target,l=t.getAttribute("data-replyto"),_=t.getAttribute("data-belowelement"),s=t.getAttribute("data-commentid"),c=t.getAttribute("data-postid");if(!_||!s||!c)return;e.preventDefault(),i.textContent=l,function(e,t){var i=n.getElementById(e),o=n.querySelector("[data-respondelement]");a.querySelector('input[name="parent"]').value=t,function(e){var t="js-temp-form-div",i=n.getElementById(t);i||((i=n.createElement("div")).setAttribute("id",t),i.style.display="none",e.parentNode.insertBefore(i,e))}(o),function(e){var t="js-cancel-reply",i=n.getElementById(t);if(i)i.style.display="";else{var o=e.querySelector("div");(i=n.createElement("button")).setAttribute("id",t),i.setAttribute("class","button button--ghost"),i.textContent=r,o.appendChild(i)}}(o),i.parentNode.insertBefore(o,i.nextSibling)}(_,s)}if(e.target.matches("#js-cancel-reply")){var d=n.getElementById("js-temp-form-div"),m=n.querySelector("[data-respondelement]");i.textContent=o,d.parentNode.replaceChild(m,d),m.querySelector('input[name="parent"]').value="",e.target.style.display="none"}}),!1))}}(window)})()})(); \ No newline at end of file +(()=>{"use strict";var e={3:(e,t,n)=>{n.r(t),n.d(t,{translate:()=>i});const i={translations:{ar:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},de:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},en:{admin:"Admin",backToMainMenu:"Back to main menu",cancelReply:"Cancel reply",controlsDescription:"carousel controls","logged-in":"logged in",logout:"Logout","member-site":"Member site",menu:"Menu","my-account":"My account","my-calendar":"My calendar","my-organization":"My organization",nextSlide:"next slide",previousSlide:"previous slide","sign-in":"Sign in",sliderDescription:"carousel",slideText:"Slide {x} of {y}","team-site":"Team site"},es:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},fr:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-organization":"__my_organization","my-calendar":"__my-calendar",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},hu:{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},ja:{admin:"アドミン",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"ログアウト","member-site":"メンバーサイト",menu:"__menu","my-account":"アカウント","my-calendar":"カレンダー","my-organization":"組織",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"ログイン",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"チームサイト"},"pt-br":{admin:"__admin",backToMainMenu:"__backToMainMenu",cancelReply:"__cancelReply",controlsDescription:"__controlsDescription","logged-in":"__logged-in",logout:"__logout","member-site":"__member-site",menu:"__menu","my-account":"__my-account","my-calendar":"__my-calendar","my-organization":"__my_organization",nextSlide:"__nextSlide",previousSlide:"__previousSlide","sign-in":"__sign-in",sliderDescription:"__sliderDescription",slideText:"__Slide {x} of {y}","team-site":"__team-site"},"zh-hans":{admin:"管理",backToMainMenu:"返回主目录",cancelReply:"取消回复",controlsDescription:"轮播图控件","logged-in":"已登陆",logout:"退出登陆","member-site":"会员页面",menu:"目录","my-account":"我的账号","my-calendar":"我的日历","my-organization":"我所在的组织",nextSlide:"下一页",previousSlide:"上一页","sign-in":"登陆",sliderDescription:"轮播图",slideText:"第{x}/{y}页","team-site":"员工页面"}},translate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(null==e||e.length<1)){null!=t&&void 0!==this.translations[t]||(t="en");var i=this.translations[t][e],o=Object.keys(n);if(o.length>0)for(var a=0;a{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};(()=>{n.r(i);var e=n(3);document.querySelectorAll(".comment__author time").forEach((function(e){e.setAttribute("title",e.innerHTML.trim());const t=new Date(e.getAttribute("datetime")),n=Math.round((t.getTime()-Date.now())/1e3),i=Math.round(n/60),o=Math.round(n/3600),a=Math.round(n/86400),r=Math.round(n/2592e3),l=Math.round(n/31536e3),_=new Intl.RelativeTimeFormat(document.documentElement.lang,{numeric:"auto"});e.innerHTML=0!=l?_.format(l,"years"):0!=r?_.format(r,"months"):0!=a?_.format(a,"days"):0!=o?_.format(o,"hours"):0!=i?_.format(i,"minutes"):_.format(n,"seconds")})),window.addComment=function(t){let n=t.document,i=n.querySelector('[data-title="reply"]');if(!i)return;let o=i.textContent,a=n.getElementById("comment-form"),r=e.translate.translate("cancelReply",n.documentElement.lang);"interactive"===n.readyState&&(Array.prototype.slice.call(n.querySelectorAll("[data-replylink]")).forEach((function(e){let t=e.dataset,i=n.createElement("button");i.setAttribute("class","button button--ghost"),i.innerHTML=e.innerHTML;for(let e in t)i.setAttribute("data-"+e,t[e]);e.parentNode.replaceChild(i,e)})),a.querySelector('[type="submit"]').nextElementSibling.style.display="none",n.addEventListener("click",(function(e){if(e.target.matches("[data-replylink]")){let t=e.target,o=t.getAttribute("data-replyto"),l=t.getAttribute("data-belowelement"),_=t.getAttribute("data-commentid"),c=t.getAttribute("data-postid");if(!l||!_||!c)return;e.preventDefault(),i.textContent=o,function(e,t){let i=n.getElementById(e),o=n.querySelector("[data-respondelement]");a.querySelector('input[name="parent"]').value=t,function(e){let t="js-temp-form-div",i=n.getElementById(t);i||(i=n.createElement("div"),i.setAttribute("id",t),i.style.display="none",e.parentNode.insertBefore(i,e))}(o),function(e){let t="js-cancel-reply",i=n.getElementById(t);if(i)return void(i.style.display="");let o=e.querySelector("div");i=n.createElement("button"),i.setAttribute("id",t),i.setAttribute("class","button button--ghost"),i.textContent=r,o.appendChild(i)}(o),i.parentNode.insertBefore(o,i.nextSibling)}(l,_)}if(e.target.matches("#js-cancel-reply")){let t=n.getElementById("js-temp-form-div"),a=n.querySelector("[data-respondelement]");i.textContent=o,t.parentNode.replaceChild(a,t),a.querySelector('input[name="parent"]').value="",e.target.style.display="none"}}),!1))}(window)})()})(); \ No newline at end of file diff --git a/public/dist/assets/js/country-autocomplete.js b/public/dist/assets/js/country-autocomplete.js index 608c70b3..3a393e77 100644 --- a/public/dist/assets/js/country-autocomplete.js +++ b/public/dist/assets/js/country-autocomplete.js @@ -17,32 +17,33 @@ __webpack_require__.r(__webpack_exports__); function simpleAccessibleAutocomplete(id) { - var element = document.getElementById(id); + const element = document.getElementById(id); if (element) { - // If a reset button is used to clear the input, reflect this in the underlying + // and collapse the dropdown menu + function resetHandler() { + // Clear autocomplete and hidden select + const enhancedElement = element.parentElement.querySelector('input'); + enhancedElement.value = ''; + element.value = ''; + + // Collapse the dropdown menu + enhancedElement.click(); + enhancedElement.focus(); + enhancedElement.blur(); + } document.addEventListener('click', function (event) { if (event.target.matches('button[type="reset"]')) { resetHandler(); diff --git a/public/dist/assets/js/country-autocomplete.min.js b/public/dist/assets/js/country-autocomplete.min.js index 0a6a69d7..46bc2aa6 100644 --- a/public/dist/assets/js/country-autocomplete.min.js +++ b/public/dist/assets/js/country-autocomplete.min.js @@ -1 +1 @@ -(()=>{var e=[(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i});var r=n(1),o=n.n(r);const i=function(e){var t=document.getElementById(e);t&&(o().enhanceSelectElement({confirmOnBlur:!1,defaultValue:"",displayMenu:"overlay",dropdownArrow:function(e){return''},preserveNullOptions:!0,selectElement:t,showAllValues:!0}),document.addEventListener("click",(function(e){var n;e.target.matches('button[type="reset"]')&&((n=t.parentElement.querySelector("input")).value="",t.value="",n.click(),n.focus(),n.blur())}),!1))}},e=>{var t;window,t=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=37)}([function(e,t,n){var r=n(1),o=n(6),i=n(7),u=n(16),a=n(18),l="prototype",s=function(e,t,n){var c,p,f,d,h=e&s.F,v=e&s.G,m=e&s.S,y=e&s.P,g=e&s.B,_=v?r:m?r[t]||(r[t]={}):(r[t]||{})[l],b=v?o:o[t]||(o[t]={}),w=b[l]||(b[l]={});for(c in v&&(n=t),n)f=((p=!h&&_&&void 0!==_[c])?_:n)[c],d=g&&p?a(f,r):y&&"function"==typeof f?a(Function.call,f):f,_&&u(_,c,f,e&s.U),b[c]!=f&&i(b,c,d),y&&w[c]!=f&&(w[c]=f)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){e.exports=!n(4)((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"h",(function(){return a})),n.d(t,"createElement",(function(){return a})),n.d(t,"cloneElement",(function(){return c})),n.d(t,"Component",(function(){return L})),n.d(t,"render",(function(){return B})),n.d(t,"rerender",(function(){return h})),n.d(t,"options",(function(){return o}));var r=function(){},o={},i=[],u=[];function a(e,t){var n,a,l,s,c=u;for(s=arguments.length;2l;)r(a,n=t[l++])&&(~i(s,n)||s.push(n));return s}},function(e,t,n){var r=n(25),o=Math.max,i=Math.min;e.exports=function(e,t){return(e=r(e))<0?o(e+t,0):i(e,t)}},function(e,t){e.exports=!1},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(48);e.exports=function(e,t){return new(r(e))(t)}},function(e,t,n){var r=n(2),o=n(33),i=n(34)("species");e.exports=function(e){var t;return o(e)&&("function"!=typeof(t=e.constructor)||t!==Array&&!o(t.prototype)||(t=void 0),r(t)&&null===(t=t[i])&&(t=void 0)),void 0===t?Array:t}},function(e,t,n){"use strict";var r=n(0),o=n(32)(2);r(r.P+r.F*!n(13)([].filter,!0),"Array",{filter:function(e){return o(this,e,arguments[1])}})},function(e,t,n){var r=n(0);r(r.S,"Array",{isArray:n(33)})},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0,n(14),n(36),n(30),n(31),n(35),n(55),n(58);var r=n(5),o=u(n(60)),i=u(n(61));function u(e){return e&&e.__esModule?e:{default:e}}function a(){return(a=Object.assign||function(e){for(var t=1;t=r;this.setState({query:a,ariaHint:l}),i||!l&&s&&c?o(a,(function(e){var n=0=i&&0=s,T=this.props.showNoOptionsFound&&A&&j&&L&&B,D=i+"__wrapper",F=i+"__input",R=null!==O?" "+F+"--focused":"",V=this.props.showAllValues?" "+F+"--show-all-values":" "+F+"--default",U=i+"__dropdown-arrow-down",q=-1!==O&&null!==O,W=i+"__menu",H=W+"--"+u,K=W+"--"+(S||T?"visible":"hidden"),Q=i+"__option",z=i+"__hint",G=this.templateInputValue(E[N]),$=G&&0===G.toLowerCase().indexOf(M.toLowerCase())&&k?M+G.substr(M.length):"",J=l+"__assistiveHint",X=I?{"aria-describedby":J}:null;return h&&"string"==typeof(e=w({className:U}))&&(e=(0,r.createElement)("div",{className:i+"__dropdown-arrow-down-wrapper",dangerouslySetInnerHTML:{__html:e}})),(0,r.createElement)("div",{className:D,onKeyDown:this.handleKeyDown},(0,r.createElement)(o.default,{id:l,length:E.length,queryLength:M.length,minQueryLength:s,selectedOption:this.templateInputValue(E[N]),selectedOptionIndex:N,validChoiceMade:P,isInFocus:null!==this.state.focused,tQueryTooShort:m,tNoResults:y,tSelectedOption:g,tResults:_}),$&&(0,r.createElement)("span",null,(0,r.createElement)("input",{className:z,readonly:!0,tabIndex:"-1",value:$})),(0,r.createElement)("input",a({"aria-expanded":S?"true":"false","aria-activedescendant":!!q&&l+"__option--"+O,"aria-owns":l+"__listbox","aria-autocomplete":this.hasAutoselect()?"both":"list"},X,{autoComplete:"off",className:""+F+R+V,id:l,onClick:function(e){return t.handleInputClick(e)},onBlur:this.handleInputBlur},function(e){return{onInput:e}}(this.handleInputChange),{onFocus:this.handleInputFocus,name:p,placeholder:f,ref:function(e){t.elementReferences[-1]=e},type:"text",role:"combobox",required:d,value:M})),e,(0,r.createElement)("ul",{className:W+" "+H+" "+K,onMouseLeave:function(e){return t.handleListMouseLeave(e)},id:l+"__listbox",role:"listbox"},E.map((function(e,n){var o=(-1===O?N===n:O===n)&&null===C?" "+Q+"--focused":"",i=n%2?" "+Q+"--odd":"",u=c()?" '+(n+1)+" of "+E.length+"":"";return(0,r.createElement)("li",{"aria-selected":O===n?"true":"false",className:""+Q+o+i,dangerouslySetInnerHTML:{__html:t.templateSuggestion(e)+u},id:l+"__option--"+n,key:n,onBlur:function(e){return t.handleOptionBlur(e,n)},onClick:function(e){return t.handleOptionClick(e,n)},onMouseDown:t.handleOptionMouseDown,onMouseEnter:function(e){return t.handleOptionMouseEnter(e,n)},ref:function(e){t.elementReferences[n]=e},role:"option",tabIndex:"-1","aria-posinset":n+1,"aria-setsize":E.length})})),T&&(0,r.createElement)("li",{className:Q+" "+Q+"--no-results"},v())),(0,r.createElement)("span",{id:J,style:{display:"none"}},b()))},t}(r.Component);(t.default=p).defaultProps={autoselect:!1,cssNamespace:"autocomplete",defaultValue:"",displayMenu:"inline",minLength:0,name:"input-autocomplete",placeholder:"",onConfirm:function(){},confirmOnBlur:!0,showNoOptionsFound:!0,showAllValues:!1,required:!1,tNoResults:function(){return"No results found"},tAssistiveHint:function(){return"When autocomplete results are available use up and down arrows to review and enter to select. Touch device users, explore by touch or with swipe gestures."},dropdownArrow:i.default}},function(e,t,n){var r=n(9),o=n(53),i=n(28),u=n(26)("IE_PROTO"),a=function(){},l="prototype",s=function(){var e,t=n(15)("iframe"),r=i.length;for(t.style.display="none",n(54).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("