@govtechsg/oobee 0.10.76 → 0.10.78-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/publish.yml +8 -1
- package/INTEGRATION.md +50 -3
- package/dist/cli.js +252 -0
- package/dist/combine.js +221 -0
- package/dist/constants/cliFunctions.js +306 -0
- package/dist/constants/common.js +1669 -0
- package/dist/constants/constants.js +913 -0
- package/dist/constants/errorMeta.json +319 -0
- package/dist/constants/itemTypeDescription.js +7 -0
- package/dist/constants/oobeeAi.js +121 -0
- package/dist/constants/questions.js +151 -0
- package/dist/constants/sampleData.js +176 -0
- package/dist/crawlers/commonCrawlerFunc.js +428 -0
- package/dist/crawlers/crawlDomain.js +613 -0
- package/dist/crawlers/crawlIntelligentSitemap.js +135 -0
- package/dist/crawlers/crawlLocalFile.js +151 -0
- package/dist/crawlers/crawlSitemap.js +303 -0
- package/dist/crawlers/custom/escapeCssSelector.js +10 -0
- package/dist/crawlers/custom/evaluateAltText.js +11 -0
- package/dist/crawlers/custom/extractAndGradeText.js +44 -0
- package/dist/crawlers/custom/extractText.js +27 -0
- package/dist/crawlers/custom/findElementByCssSelector.js +36 -0
- package/dist/crawlers/custom/flagUnlabelledClickableElements.js +963 -0
- package/dist/crawlers/custom/framesCheck.js +37 -0
- package/dist/crawlers/custom/getAxeConfiguration.js +111 -0
- package/dist/crawlers/custom/gradeReadability.js +23 -0
- package/dist/crawlers/custom/utils.js +1024 -0
- package/dist/crawlers/custom/xPathToCss.js +147 -0
- package/dist/crawlers/guards/urlGuard.js +71 -0
- package/dist/crawlers/pdfScanFunc.js +276 -0
- package/dist/crawlers/runCustom.js +89 -0
- package/dist/exclusions.txt +7 -0
- package/dist/generateHtmlReport.js +144 -0
- package/dist/index.js +62 -0
- package/dist/logs.js +84 -0
- package/dist/mergeAxeResults.js +1588 -0
- package/dist/npmIndex.js +640 -0
- package/dist/proxyService.js +360 -0
- package/dist/runGenerateJustHtmlReport.js +16 -0
- package/dist/screenshotFunc/htmlScreenshotFunc.js +355 -0
- package/dist/screenshotFunc/pdfScreenshotFunc.js +645 -0
- package/dist/services/s3Uploader.js +127 -0
- package/dist/static/ejs/partials/components/allIssues/AllIssues.ejs +9 -0
- package/dist/static/ejs/partials/components/allIssues/CategoryBadges.ejs +82 -0
- package/dist/static/ejs/partials/components/allIssues/FilterBar.ejs +33 -0
- package/dist/static/ejs/partials/components/allIssues/IssuesTable.ejs +41 -0
- package/dist/static/ejs/partials/components/header/SiteInfo.ejs +119 -0
- package/dist/static/ejs/partials/components/header/aboutScanModal/AboutScanModal.ejs +15 -0
- package/dist/static/ejs/partials/components/header/aboutScanModal/ScanConfiguration.ejs +44 -0
- package/dist/static/ejs/partials/components/header/aboutScanModal/ScanDetails.ejs +142 -0
- package/dist/static/ejs/partials/components/prioritiseIssues/IssueDetailCard.ejs +36 -0
- package/dist/static/ejs/partials/components/prioritiseIssues/PrioritiseIssues.ejs +47 -0
- package/dist/static/ejs/partials/components/ruleModal/ruleOffcanvas.ejs +196 -0
- package/dist/static/ejs/partials/components/scannedPagesSegmentedTabs.ejs +48 -0
- package/dist/static/ejs/partials/components/screenshotLightbox.ejs +13 -0
- package/dist/static/ejs/partials/components/shared/InfoAlert.ejs +3 -0
- package/dist/static/ejs/partials/components/summaryScanAbout.ejs +141 -0
- package/dist/static/ejs/partials/components/summaryScanResults.ejs +16 -0
- package/dist/static/ejs/partials/components/summaryTable.ejs +20 -0
- package/dist/static/ejs/partials/components/summaryWcagCompliance.ejs +94 -0
- package/dist/static/ejs/partials/components/topTen.ejs +6 -0
- package/dist/static/ejs/partials/components/wcagCompliance/FailedCriteria.ejs +47 -0
- package/dist/static/ejs/partials/components/wcagCompliance/WcagCompliance.ejs +16 -0
- package/dist/static/ejs/partials/components/wcagCompliance/WcagGaugeBar.ejs +16 -0
- package/dist/static/ejs/partials/components/wcagCoverageDetails.ejs +18 -0
- package/dist/static/ejs/partials/footer.ejs +24 -0
- package/dist/static/ejs/partials/header.ejs +14 -0
- package/dist/static/ejs/partials/main.ejs +29 -0
- package/dist/static/ejs/partials/scripts/allIssues/AllIssues.ejs +376 -0
- package/dist/static/ejs/partials/scripts/bootstrap.ejs +8 -0
- package/dist/static/ejs/partials/scripts/categorySummary.ejs +141 -0
- package/dist/static/ejs/partials/scripts/decodeUnzipParse.ejs +3 -0
- package/dist/static/ejs/partials/scripts/header/SiteInfo.ejs +44 -0
- package/dist/static/ejs/partials/scripts/header/aboutScanModal/AboutScanModal.ejs +51 -0
- package/dist/static/ejs/partials/scripts/header/aboutScanModal/ScanConfiguration.ejs +127 -0
- package/dist/static/ejs/partials/scripts/header/aboutScanModal/ScanDetails.ejs +60 -0
- package/dist/static/ejs/partials/scripts/highlightjs.ejs +335 -0
- package/dist/static/ejs/partials/scripts/popper.ejs +7 -0
- package/dist/static/ejs/partials/scripts/prioritiseIssues/IssueDetailCard.ejs +137 -0
- package/dist/static/ejs/partials/scripts/prioritiseIssues/PrioritiseIssues.ejs +214 -0
- package/dist/static/ejs/partials/scripts/prioritiseIssues/wcagSvgMap.ejs +861 -0
- package/dist/static/ejs/partials/scripts/ruleModal/constants.ejs +957 -0
- package/dist/static/ejs/partials/scripts/ruleModal/itemCardRenderer.ejs +353 -0
- package/dist/static/ejs/partials/scripts/ruleModal/pageAccordionBuilder.ejs +468 -0
- package/dist/static/ejs/partials/scripts/ruleModal/ruleOffcanvas.ejs +306 -0
- package/dist/static/ejs/partials/scripts/ruleModal/utilities.ejs +483 -0
- package/dist/static/ejs/partials/scripts/scannedPagesSegmentedTabs.ejs +35 -0
- package/dist/static/ejs/partials/scripts/screenshotLightbox.ejs +75 -0
- package/dist/static/ejs/partials/scripts/summaryScanResults.ejs +14 -0
- package/dist/static/ejs/partials/scripts/summaryTable.ejs +78 -0
- package/dist/static/ejs/partials/scripts/topTen.ejs +61 -0
- package/dist/static/ejs/partials/scripts/utils.ejs +453 -0
- package/dist/static/ejs/partials/scripts/wcagCompliance/FailedCriteria.ejs +103 -0
- package/dist/static/ejs/partials/scripts/wcagCompliance/WcagGaugeBar.ejs +47 -0
- package/dist/static/ejs/partials/scripts/wcagCompliance.ejs +15 -0
- package/dist/static/ejs/partials/scripts/wcagCoverageDetails.ejs +75 -0
- package/dist/static/ejs/partials/styles/allIssues/AllIssues.ejs +384 -0
- package/dist/static/ejs/partials/styles/bootstrap.ejs +12391 -0
- package/dist/static/ejs/partials/styles/header/SiteInfo.ejs +121 -0
- package/dist/static/ejs/partials/styles/header/aboutScanModal/AboutScanModal.ejs +82 -0
- package/dist/static/ejs/partials/styles/header/aboutScanModal/ScanConfiguration.ejs +50 -0
- package/dist/static/ejs/partials/styles/header/aboutScanModal/ScanDetails.ejs +149 -0
- package/dist/static/ejs/partials/styles/header.ejs +7 -0
- package/dist/static/ejs/partials/styles/highlightjs.ejs +54 -0
- package/dist/static/ejs/partials/styles/prioritiseIssues/IssueDetailCard.ejs +141 -0
- package/dist/static/ejs/partials/styles/prioritiseIssues/PrioritiseIssues.ejs +204 -0
- package/dist/static/ejs/partials/styles/ruleModal/ruleOffcanvas.ejs +456 -0
- package/dist/static/ejs/partials/styles/scannedPagesSegmentedTabs.ejs +46 -0
- package/dist/static/ejs/partials/styles/shared/InfoAlert.ejs +12 -0
- package/dist/static/ejs/partials/styles/styles.ejs +1607 -0
- package/dist/static/ejs/partials/styles/summaryBootstrap.ejs +12458 -0
- package/dist/static/ejs/partials/styles/topTenCard.ejs +44 -0
- package/dist/static/ejs/partials/styles/wcagCompliance/FailedCriteria.ejs +59 -0
- package/dist/static/ejs/partials/styles/wcagCompliance/WcagGaugeBar.ejs +62 -0
- package/dist/static/ejs/partials/styles/wcagCompliance.ejs +36 -0
- package/dist/static/ejs/partials/styles/wcagCoverageDetails.ejs +33 -0
- package/dist/static/ejs/partials/summaryHeader.ejs +70 -0
- package/dist/static/ejs/partials/summaryMain.ejs +49 -0
- package/dist/static/ejs/report.ejs +226 -0
- package/dist/static/ejs/summary.ejs +47 -0
- package/dist/types/types.js +1 -0
- package/dist/utils.js +1070 -0
- package/examples/oobee-cypress-integration-js/cypress/support/e2e.js +36 -6
- package/examples/oobee-cypress-integration-js/cypress.config.js +45 -1
- package/examples/oobee-cypress-integration-ts/cypress.config.ts +47 -1
- package/examples/oobee-cypress-integration-ts/src/cypress/support/e2e.ts +36 -6
- package/examples/oobee-playwright-integration-js/oobee-playwright-demo.js +2 -1
- package/examples/oobee-playwright-integration-ts/src/oobee-playwright-demo.ts +2 -1
- package/examples/oobee-scan-html-demo.js +51 -0
- package/examples/oobee-scan-page-demo.js +40 -0
- package/package.json +9 -3
- package/src/constants/common.ts +2 -2
- package/src/constants/constants.ts +3 -1
- package/src/crawlers/crawlDomain.ts +1 -0
- package/src/crawlers/runCustom.ts +0 -1
- package/src/mergeAxeResults.ts +43 -22
- package/src/npmIndex.ts +500 -131
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* @popperjs/core v2.9.2 - MIT License
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Popper={})}(this,(function(e){function t(e){return{width:(e=e.getBoundingClientRect()).width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left,x:e.left,y:e.top}}function n(e){return null==e?window:"[object Window]"!==e.toString()?(e=e.ownerDocument)&&e.defaultView||window:e}function o(e){return{scrollLeft:(e=n(e)).pageXOffset,scrollTop:e.pageYOffset}}function r(e){return e instanceof n(e).Element||e instanceof Element}function i(e){return e instanceof n(e).HTMLElement||e instanceof HTMLElement}function a(e){return"undefined"!=typeof ShadowRoot&&(e instanceof n(e).ShadowRoot||e instanceof ShadowRoot)}function s(e){return e?(e.nodeName||"").toLowerCase():null}function f(e){return((r(e)?e.ownerDocument:e.document)||window.document).documentElement}function p(e){return t(f(e)).left+o(e).scrollLeft}function c(e){return n(e).getComputedStyle(e)}function l(e){return e=c(e),/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function u(e,r,a){void 0===a&&(a=!1);var c=f(r);e=t(e);var u=i(r),d={scrollLeft:0,scrollTop:0},m={x:0,y:0};return(u||!u&&!a)&&(("body"!==s(r)||l(c))&&(d=r!==n(r)&&i(r)?{scrollLeft:r.scrollLeft,scrollTop:r.scrollTop}:o(r)),i(r)?((m=t(r)).x+=r.clientLeft,m.y+=r.clientTop):c&&(m.x=p(c))),{x:e.left+d.scrollLeft-m.x,y:e.top+d.scrollTop-m.y,width:e.width,height:e.height}}function d(e){var n=t(e),o=e.offsetWidth,r=e.offsetHeight;return 1>=Math.abs(n.width-o)&&(o=n.width),1>=Math.abs(n.height-r)&&(r=n.height),{x:e.offsetLeft,y:e.offsetTop,width:o,height:r}}function m(e){return"html"===s(e)?e:e.assignedSlot||e.parentNode||(a(e)?e.host:null)||f(e)}function h(e){return 0<=["html","body","#document"].indexOf(s(e))?e.ownerDocument.body:i(e)&&l(e)?e:h(m(e))}function v(e,t){var o;void 0===t&&(t=[]);var r=h(e);return e=r===(null==(o=e.ownerDocument)?void 0:o.body),o=n(r),r=e?[o].concat(o.visualViewport||[],l(r)?r:[]):r,t=t.concat(r),e?t:t.concat(v(m(r)))}function g(e){return i(e)&&"fixed"!==c(e).position?e.offsetParent:null}function y(e){for(var t=n(e),o=g(e);o&&0<=["table","td","th"].indexOf(s(o))&&"static"===c(o).position;)o=g(o);if(o&&("html"===s(o)||"body"===s(o)&&"static"===c(o).position))return t;if(!o)e:{if(o=-1!==navigator.userAgent.toLowerCase().indexOf("firefox"),-1===navigator.userAgent.indexOf("Trident")||!i(e)||"fixed"!==c(e).position)for(e=m(e);i(e)&&0>["html","body"].indexOf(s(e));){var r=c(e);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||o&&"filter"===r.willChange||o&&r.filter&&"none"!==r.filter){o=e;break e}e=e.parentNode}o=null}return o||t}function b(e){function t(e){o.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){o.has(e)||(e=n.get(e))&&t(e)})),r.push(e)}var n=new Map,o=new Set,r=[];return e.forEach((function(e){n.set(e.name,e)})),e.forEach((function(e){o.has(e.name)||t(e)})),r}function w(e){var t;return function(){return t||(t=new Promise((function(n){Promise.resolve().then((function(){t=void 0,n(e())}))}))),t}}function x(e){return e.split("-")[0]}function O(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&a(n))do{if(t&&e.isSameNode(t))return!0;t=t.parentNode||t.host}while(t);return!1}function j(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function E(e,r){if("viewport"===r){r=n(e);var a=f(e);r=r.visualViewport;var s=a.clientWidth;a=a.clientHeight;var l=0,u=0;r&&(s=r.width,a=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(l=r.offsetLeft,u=r.offsetTop)),e=j(e={width:s,height:a,x:l+p(e),y:u})}else i(r)?((e=t(r)).top+=r.clientTop,e.left+=r.clientLeft,e.bottom=e.top+r.clientHeight,e.right=e.left+r.clientWidth,e.width=r.clientWidth,e.height=r.clientHeight,e.x=e.left,e.y=e.top):(u=f(e),e=f(u),s=o(u),r=null==(a=u.ownerDocument)?void 0:a.body,a=_(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),l=_(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),u=-s.scrollLeft+p(u),s=-s.scrollTop,"rtl"===c(r||e).direction&&(u+=_(e.clientWidth,r?r.clientWidth:0)-a),e=j({width:a,height:l,x:u,y:s}));return e}function D(e,t,n){return t="clippingParents"===t?function(e){var t=v(m(e)),n=0<=["absolute","fixed"].indexOf(c(e).position)&&i(e)?y(e):e;return r(n)?t.filter((function(e){return r(e)&&O(e,n)&&"body"!==s(e)})):[]}(e):[].concat(t),(n=(n=[].concat(t,[n])).reduce((function(t,n){return n=E(e,n),t.top=_(n.top,t.top),t.right=U(n.right,t.right),t.bottom=U(n.bottom,t.bottom),t.left=_(n.left,t.left),t}),E(e,n[0]))).width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}function L(e){return 0<=["top","bottom"].indexOf(e)?"x":"y"}function P(e){var t=e.reference,n=e.element,o=(e=e.placement)?x(e):null;e=e?e.split("-")[1]:null;var r=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2;switch(o){case"top":r={x:r,y:t.y-n.height};break;case"bottom":r={x:r,y:t.y+t.height};break;case"right":r={x:t.x+t.width,y:i};break;case"left":r={x:t.x-n.width,y:i};break;default:r={x:t.x,y:t.y}}if(null!=(o=o?L(o):null))switch(i="y"===o?"height":"width",e){case"start":r[o]-=t[i]/2-n[i]/2;break;case"end":r[o]+=t[i]/2-n[i]/2}return r}function M(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function k(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function A(e,n){void 0===n&&(n={});var o=n;n=void 0===(n=o.placement)?e.placement:n;var i=o.boundary,a=void 0===i?"clippingParents":i,s=void 0===(i=o.rootBoundary)?"viewport":i;i=void 0===(i=o.elementContext)?"popper":i;var p=o.altBoundary,c=void 0!==p&&p;o=M("number"!=typeof(o=void 0===(o=o.padding)?0:o)?o:k(o,C));var l=e.elements.reference;p=e.rects.popper,a=D(r(c=e.elements[c?"popper"===i?"reference":"popper":i])?c:c.contextElement||f(e.elements.popper),a,s),c=P({reference:s=t(l),element:p,strategy:"absolute",placement:n}),p=j(Object.assign({},p,c)),s="popper"===i?p:s;var u={top:a.top-s.top+o.top,bottom:s.bottom-a.bottom+o.bottom,left:a.left-s.left+o.left,right:s.right-a.right+o.right};if(e=e.modifiersData.offset,"popper"===i&&e){var d=e[n];Object.keys(u).forEach((function(e){var t=0<=["right","bottom"].indexOf(e)?1:-1,n=0<=["top","bottom"].indexOf(e)?"y":"x";u[e]+=d[n]*t}))}return u}function W(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function B(e){void 0===e&&(e={});var t=e.defaultModifiers,n=void 0===t?[]:t,o=void 0===(e=e.defaultOptions)?F:e;return function(e,t,i){function a(){f.forEach((function(e){return e()})),f=[]}void 0===i&&(i=o);var s={placement:"bottom",orderedModifiers:[],options:Object.assign({},F,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},f=[],p=!1,c={state:s,setOptions:function(i){return a(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:r(e)?v(e):e.contextElement?v(e.contextElement):[],popper:v(t)},i=function(e){var t=b(e);return I.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}(function(e){var t=e.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,s.options.modifiers))),s.orderedModifiers=i.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options;n=void 0===n?{}:n,"function"==typeof(e=e.effect)&&(t=e({state:s,name:t,instance:c,options:n}),f.push(t||function(){}))})),c.update()},forceUpdate:function(){if(!p){var e=s.elements,t=e.reference;if(W(t,e=e.popper))for(s.rects={reference:u(t,y(e),"fixed"===s.options.strategy),popper:d(e)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)})),t=0;t<s.orderedModifiers.length;t++)if(!0===s.reset)s.reset=!1,t=-1;else{var n=s.orderedModifiers[t];e=n.fn;var o=n.options;o=void 0===o?{}:o,n=n.name,"function"==typeof e&&(s=e({state:s,options:o,name:n,instance:c})||s)}}},update:w((function(){return new Promise((function(e){c.forceUpdate(),e(s)}))})),destroy:function(){a(),p=!0}};return W(e,t)?(c.setOptions(i).then((function(e){!p&&i.onFirstUpdate&&i.onFirstUpdate(e)})),c):c}}function T(e){var t,o=e.popper,r=e.popperRect,i=e.placement,a=e.offsets,s=e.position,p=e.gpuAcceleration,l=e.adaptive;if(!0===(e=e.roundOffsets)){e=a.y;var u=window.devicePixelRatio||1;e={x:z(z(a.x*u)/u)||0,y:z(z(e*u)/u)||0}}else e="function"==typeof e?e(a):a;e=void 0===(e=(u=e).x)?0:e,u=void 0===(u=u.y)?0:u;var d=a.hasOwnProperty("x");a=a.hasOwnProperty("y");var m,h="left",v="top",g=window;if(l){var b=y(o),w="clientHeight",x="clientWidth";b===n(o)&&("static"!==c(b=f(o)).position&&(w="scrollHeight",x="scrollWidth")),"top"===i&&(v="bottom",u-=b[w]-r.height,u*=p?1:-1),"left"===i&&(h="right",e-=b[x]-r.width,e*=p?1:-1)}return o=Object.assign({position:s},l&&J),p?Object.assign({},o,((m={})[v]=a?"0":"",m[h]=d?"0":"",m.transform=2>(g.devicePixelRatio||1)?"translate("+e+"px, "+u+"px)":"translate3d("+e+"px, "+u+"px, 0)",m)):Object.assign({},o,((t={})[v]=a?u+"px":"",t[h]=d?e+"px":"",t.transform="",t))}function H(e){return e.replace(/left|right|bottom|top/g,(function(e){return $[e]}))}function R(e){return e.replace(/start|end/g,(function(e){return ee[e]}))}function S(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function q(e){return["top","right","bottom","left"].some((function(t){return 0<=e[t]}))}var C=["top","bottom","right","left"],N=C.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),V=[].concat(C,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),I="beforeRead read afterRead beforeMain main afterMain beforeWrite write afterWrite".split(" "),_=Math.max,U=Math.min,z=Math.round,F={placement:"bottom",modifiers:[],strategy:"absolute"},X={passive:!0},Y={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,o=e.instance,r=(e=e.options).scroll,i=void 0===r||r,a=void 0===(e=e.resize)||e,s=n(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&f.forEach((function(e){e.addEventListener("scroll",o.update,X)})),a&&s.addEventListener("resize",o.update,X),function(){i&&f.forEach((function(e){e.removeEventListener("scroll",o.update,X)})),a&&s.removeEventListener("resize",o.update,X)}},data:{}},G={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state;t.modifiersData[e.name]=P({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},J={top:"auto",right:"auto",bottom:"auto",left:"auto"},K={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options;e=void 0===(e=n.gpuAcceleration)||e;var o=n.adaptive;o=void 0===o||o,n=void 0===(n=n.roundOffsets)||n,e={placement:x(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:e},null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,T(Object.assign({},e,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:n})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,T(Object.assign({},e,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:n})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Q={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},o=t.attributes[e]||{},r=t.elements[e];i(r)&&s(r)&&(Object.assign(r.style,n),Object.keys(o).forEach((function(e){var t=o[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var o=t.elements[e],r=t.attributes[e]||{};e=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{}),i(o)&&s(o)&&(Object.assign(o.style,e),Object.keys(r).forEach((function(e){o.removeAttribute(e)})))}))}},requires:["computeStyles"]},Z={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.name,o=void 0===(e=e.options.offset)?[0,0]:e,r=(e=V.reduce((function(e,n){var r=t.rects,i=x(n),a=0<=["left","top"].indexOf(i)?-1:1,s="function"==typeof o?o(Object.assign({},r,{placement:n})):o;return r=(r=s[0])||0,s=((s=s[1])||0)*a,i=0<=["left","right"].indexOf(i)?{x:s,y:r}:{x:r,y:s},e[n]=i,e}),{}))[t.placement],i=r.x;r=r.y,null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=r),t.modifiersData[n]=e}},$={left:"right",right:"left",bottom:"top",top:"bottom"},ee={start:"end",end:"start"},te={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;if(e=e.name,!t.modifiersData[e]._skip){var o=n.mainAxis;o=void 0===o||o;var r=n.altAxis;r=void 0===r||r;var i=n.fallbackPlacements,a=n.padding,s=n.boundary,f=n.rootBoundary,p=n.altBoundary,c=n.flipVariations,l=void 0===c||c,u=n.allowedAutoPlacements;c=x(n=t.options.placement),i=i||(c!==n&&l?function(e){if("auto"===x(e))return[];var t=H(e);return[R(e),t,R(t)]}(n):[H(n)]);var d=[n].concat(i).reduce((function(e,n){return e.concat("auto"===x(n)?function(e,t){void 0===t&&(t={});var n=t.boundary,o=t.rootBoundary,r=t.padding,i=t.flipVariations,a=t.allowedAutoPlacements,s=void 0===a?V:a,f=t.placement.split("-")[1];0===(i=(t=f?i?N:N.filter((function(e){return e.split("-")[1]===f})):C).filter((function(e){return 0<=s.indexOf(e)}))).length&&(i=t);var p=i.reduce((function(t,i){return t[i]=A(e,{placement:i,boundary:n,rootBoundary:o,padding:r})[x(i)],t}),{});return Object.keys(p).sort((function(e,t){return p[e]-p[t]}))}(t,{placement:n,boundary:s,rootBoundary:f,padding:a,flipVariations:l,allowedAutoPlacements:u}):n)}),[]);n=t.rects.reference,i=t.rects.popper;var m=new Map;c=!0;for(var h=d[0],v=0;v<d.length;v++){var g=d[v],y=x(g),b="start"===g.split("-")[1],w=0<=["top","bottom"].indexOf(y),O=w?"width":"height",j=A(t,{placement:g,boundary:s,rootBoundary:f,altBoundary:p,padding:a});if(b=w?b?"right":"left":b?"bottom":"top",n[O]>i[O]&&(b=H(b)),O=H(b),w=[],o&&w.push(0>=j[y]),r&&w.push(0>=j[b],0>=j[O]),w.every((function(e){return e}))){h=g,c=!1;break}m.set(g,w)}if(c)for(o=function(e){var t=d.find((function(t){if(t=m.get(t))return t.slice(0,e).every((function(e){return e}))}));if(t)return h=t,"break"},r=l?3:1;0<r&&"break"!==o(r);r--);t.placement!==h&&(t.modifiersData[e]._skip=!0,t.placement=h,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},ne={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options;e=e.name;var o=n.mainAxis,r=void 0===o||o,i=void 0!==(o=n.altAxis)&&o;o=void 0===(o=n.tether)||o;var a=n.tetherOffset,s=void 0===a?0:a,f=A(t,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary});n=x(t.placement);var p=t.placement.split("-")[1],c=!p,l=L(n);n="x"===l?"y":"x",a=t.modifiersData.popperOffsets;var u=t.rects.reference,m=t.rects.popper,h="function"==typeof s?s(Object.assign({},t.rects,{placement:t.placement})):s;if(s={x:0,y:0},a){if(r||i){var v="y"===l?"top":"left",g="y"===l?"bottom":"right",b="y"===l?"height":"width",w=a[l],O=a[l]+f[v],j=a[l]-f[g],E=o?-m[b]/2:0,D="start"===p?u[b]:m[b];p="start"===p?-m[b]:-u[b],m=t.elements.arrow,m=o&&m?d(m):{width:0,height:0};var P=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0};v=P[v],g=P[g],m=_(0,U(u[b],m[b])),D=c?u[b]/2-E-m-v-h:D-m-v-h,u=c?-u[b]/2+E+m+g+h:p+m+g+h,c=t.elements.arrow&&y(t.elements.arrow),h=t.modifiersData.offset?t.modifiersData.offset[t.placement][l]:0,c=a[l]+D-h-(c?"y"===l?c.clientTop||0:c.clientLeft||0:0),u=a[l]+u-h,r&&(r=o?U(O,c):O,j=o?_(j,u):j,r=_(r,U(w,j)),a[l]=r,s[l]=r-w),i&&(r=(i=a[n])+f["x"===l?"top":"left"],f=i-f["x"===l?"bottom":"right"],r=o?U(r,c):r,o=o?_(f,u):f,o=_(r,U(i,o)),a[n]=o,s[n]=o-i)}t.modifiersData[e]=s}},requiresIfExists:["offset"]},oe={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=x(n.placement);if(e=L(s),s=0<=["left","right"].indexOf(s)?"height":"width",i&&a){r=M("number"!=typeof(r="function"==typeof(r=r.padding)?r(Object.assign({},n.rects,{placement:n.placement})):r)?r:k(r,C));var f=d(i),p="y"===e?"top":"left",c="y"===e?"bottom":"right",l=n.rects.reference[s]+n.rects.reference[e]-a[e]-n.rects.popper[s];a=a[e]-n.rects.reference[e],a=(i=(i=y(i))?"y"===e?i.clientHeight||0:i.clientWidth||0:0)/2-f[s]/2+(l/2-a/2),s=_(r[p],U(a,i-f[s]-r[c])),n.modifiersData[o]=((t={})[e]=s,t.centerOffset=s-a,t)}},effect:function(e){var t=e.state;if(null!=(e=void 0===(e=e.options.element)?"[data-popper-arrow]":e)){if("string"==typeof e&&!(e=t.elements.popper.querySelector(e)))return;O(t.elements.popper,e)&&(t.elements.arrow=e)}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},re={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state;e=e.name;var n=t.rects.reference,o=t.rects.popper,r=t.modifiersData.preventOverflow,i=A(t,{elementContext:"reference"}),a=A(t,{altBoundary:!0});n=S(i,n),o=S(a,o,r),r=q(n),a=q(o),t.modifiersData[e]={referenceClippingOffsets:n,popperEscapeOffsets:o,isReferenceHidden:r,hasPopperEscaped:a},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":r,"data-popper-escaped":a})}},ie=B({defaultModifiers:[Y,G,K,Q]}),ae=[Y,G,K,Q,Z,te,ne,oe,re],se=B({defaultModifiers:ae});e.applyStyles=Q,e.arrow=oe,e.computeStyles=K,e.createPopper=se,e.createPopperLite=ie,e.defaultModifiers=ae,e.detectOverflow=A,e.eventListeners=Y,e.flip=te,e.hide=re,e.offset=Z,e.popperGenerator=B,e.popperOffsets=G,e.preventOverflow=ne,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
7
|
+
</script>
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
(function initIssueDetailCard() {
|
|
3
|
+
window.populateIssueDetailCard = function (issue) {
|
|
4
|
+
const detailCard = document.getElementById('a11yIssueDetailCard');
|
|
5
|
+
if (!detailCard) return;
|
|
6
|
+
|
|
7
|
+
detailCard.style.display = 'block';
|
|
8
|
+
|
|
9
|
+
const titleElement = document.getElementById('issueDetailTitle');
|
|
10
|
+
if (titleElement) {
|
|
11
|
+
titleElement.textContent = issue.description || 'Issue';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const imageElement = document.getElementById('issueDetailImage');
|
|
15
|
+
const imageContainer = imageElement?.closest('.issue-detail-image-container');
|
|
16
|
+
|
|
17
|
+
if (imageElement && imageContainer) {
|
|
18
|
+
let imageSrc = null;
|
|
19
|
+
|
|
20
|
+
if (issue.conformance && issue.conformance.length > 0) {
|
|
21
|
+
const wcagConformance = issue.conformance.filter(c => c.startsWith('wcag'));
|
|
22
|
+
const wcagCriteriaLabels = scanData?.wcagCriteriaLabels || {};
|
|
23
|
+
|
|
24
|
+
for (const wcag of wcagConformance) {
|
|
25
|
+
const formattedWcag = formatWcagId(wcag);
|
|
26
|
+
|
|
27
|
+
if (wcagCriteriaLabels[formattedWcag]) {
|
|
28
|
+
const svg = window.getWcagSvg ? window.getWcagSvg(formattedWcag) : null;
|
|
29
|
+
if (svg) {
|
|
30
|
+
imageSrc = window.svgToDataUrl ? window.svgToDataUrl(svg) : svg;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!imageSrc) {
|
|
38
|
+
imageContainer.style.display = 'none';
|
|
39
|
+
} else {
|
|
40
|
+
imageContainer.style.display = 'flex';
|
|
41
|
+
imageElement.src = imageSrc;
|
|
42
|
+
imageElement.alt = issue.description || 'Issue illustration';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Populate conformance badges
|
|
47
|
+
const conformanceContainer = document.getElementById('issueDetailConformance');
|
|
48
|
+
if (conformanceContainer && issue.conformance && issue.conformance.length > 0) {
|
|
49
|
+
const wcagConformance = issue.conformance.filter(c => c.startsWith('wcag'));
|
|
50
|
+
const wcagCriteriaLabels = scanData?.wcagCriteriaLabels || {};
|
|
51
|
+
|
|
52
|
+
const criteriaNumbers = [];
|
|
53
|
+
let level = null;
|
|
54
|
+
|
|
55
|
+
wcagConformance.forEach(wcag => {
|
|
56
|
+
const formattedWcag = formatWcagId(wcag);
|
|
57
|
+
|
|
58
|
+
if (wcagCriteriaLabels[formattedWcag]) {
|
|
59
|
+
criteriaNumbers.push(formattedWcag);
|
|
60
|
+
if (!level) {
|
|
61
|
+
level = wcagCriteriaLabels[formattedWcag];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const badges = criteriaNumbers.map(
|
|
67
|
+
criteria => `<span class="issue-detail-conformance-badge">${criteria}</span>`,
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
if (level) {
|
|
71
|
+
badges.push(`<span class="issue-detail-conformance-badge">Level ${level}</span>`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
conformanceContainer.innerHTML = badges.join('');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Populate long description
|
|
78
|
+
const longDescriptionElement = document.getElementById('issueDetailLongDescription');
|
|
79
|
+
const a11yRuleLongDescriptionMap = scanData?.a11yRuleLongDescriptionMap || {};
|
|
80
|
+
if (longDescriptionElement) {
|
|
81
|
+
const longDescription = a11yRuleLongDescriptionMap[issue.ruleId] || '';
|
|
82
|
+
longDescriptionElement.textContent = longDescription;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Populate disability impact
|
|
86
|
+
const disabilitySection = document.getElementById('issueDetailDisabilitySection');
|
|
87
|
+
const disabilityMessage = document.getElementById('issueDetailDisabilityMessage');
|
|
88
|
+
const disabilityBadgesMap = scanData?.disabilityBadgesMap || {};
|
|
89
|
+
const disabilities = disabilityBadgesMap[issue.ruleId] || [];
|
|
90
|
+
|
|
91
|
+
if (disabilityMessage && disabilities.length > 0) {
|
|
92
|
+
let disabilityText = '';
|
|
93
|
+
if (disabilities.length === 1) {
|
|
94
|
+
disabilityText = `${disabilities[0]} Disability `;
|
|
95
|
+
} else if (disabilities.length === 2) {
|
|
96
|
+
disabilityText = `${disabilities[0]} and ${disabilities[1]} Disability`;
|
|
97
|
+
} else {
|
|
98
|
+
const boldedDisabilities = disabilities.map(d => `${d}`);
|
|
99
|
+
const lastDisability = boldedDisabilities.pop();
|
|
100
|
+
disabilityText = `${boldedDisabilities.join(', ')} and ${lastDisability} Disability`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
disabilityMessage.innerHTML = `This issue prevents users with <span class="disability-text">${disabilityText}</span> from navigating your website.`;
|
|
104
|
+
disabilitySection.style.display = 'block';
|
|
105
|
+
} else {
|
|
106
|
+
disabilitySection.style.display = 'none';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Handle "View issue details" button
|
|
110
|
+
const viewDetailsBtn = document.getElementById('viewIssueDetailsBtn');
|
|
111
|
+
if (viewDetailsBtn) {
|
|
112
|
+
const newBtn = viewDetailsBtn.cloneNode(true);
|
|
113
|
+
viewDetailsBtn.parentNode.replaceChild(newBtn, viewDetailsBtn);
|
|
114
|
+
|
|
115
|
+
newBtn.addEventListener('click', function () {
|
|
116
|
+
const category = issue.category || 'mustFix';
|
|
117
|
+
const ruleData = scanItems[category]?.rules?.find(r => r.rule === issue.ruleId);
|
|
118
|
+
|
|
119
|
+
if (ruleData && typeof expandRule === 'function') {
|
|
120
|
+
expandRule(category, ruleData);
|
|
121
|
+
|
|
122
|
+
const modalElement = document.getElementById('expandedRule');
|
|
123
|
+
if (modalElement) {
|
|
124
|
+
const modal = bootstrap.Modal.getOrCreateInstance(modalElement);
|
|
125
|
+
modal.show();
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const detailCard = document.getElementById('a11yIssueDetailCard');
|
|
133
|
+
if (detailCard) {
|
|
134
|
+
detailCard.style.display = 'none';
|
|
135
|
+
}
|
|
136
|
+
})();
|
|
137
|
+
</script>
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
(function populatePrioritiseIssues() {
|
|
3
|
+
const a11yRuleShortDescriptionMap = scanData?.a11yRuleShortDescriptionMap || {};
|
|
4
|
+
const disabilityBadgesMap = scanData?.disabilityBadgesMap || {};
|
|
5
|
+
const wcagLinks = scanData?.wcagLinks || {};
|
|
6
|
+
const wcagViolations = scanData?.wcagViolations || [];
|
|
7
|
+
const wcagClauses = scanData?.wcagClauses || {};
|
|
8
|
+
const mustFixRules = scanItems?.mustFix?.rules || [];
|
|
9
|
+
|
|
10
|
+
const wcagCriteriaMap = new Map();
|
|
11
|
+
|
|
12
|
+
mustFixRules.forEach(rule => {
|
|
13
|
+
const ruleId = rule.rule;
|
|
14
|
+
const wcagCriteria = rule.conformance?.filter(c => c.startsWith('wcag')) || [];
|
|
15
|
+
|
|
16
|
+
wcagCriteria.forEach(wcag => {
|
|
17
|
+
const formattedWcag = formatWcagId(wcag);
|
|
18
|
+
|
|
19
|
+
if (!wcagCriteriaMap.has(formattedWcag)) {
|
|
20
|
+
const clauseKey = formattedWcag.replace('WCAG ', '');
|
|
21
|
+
wcagCriteriaMap.set(formattedWcag, {
|
|
22
|
+
id: formattedWcag,
|
|
23
|
+
name: wcagClauses[clauseKey] || formattedWcag,
|
|
24
|
+
issues: [],
|
|
25
|
+
totalIssueCount: 0,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const criteria = wcagCriteriaMap.get(formattedWcag);
|
|
30
|
+
const displayName = a11yRuleShortDescriptionMap[ruleId] || rule.description;
|
|
31
|
+
|
|
32
|
+
criteria.issues.push({
|
|
33
|
+
ruleId: ruleId,
|
|
34
|
+
description: displayName,
|
|
35
|
+
originalDescription: rule.description,
|
|
36
|
+
totalItems: rule.totalItems || 0,
|
|
37
|
+
helpUrl: rule.helpUrl || '',
|
|
38
|
+
axeImpact: rule.axeImpact || '',
|
|
39
|
+
conformance: rule.conformance || [],
|
|
40
|
+
pagesAffected: rule.pagesAffected || [],
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
criteria.totalIssueCount = criteria.issues.length || 0;
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const sortedCriteria = Array.from(wcagCriteriaMap.values()).sort((a, b) => {
|
|
48
|
+
if (a.totalIssueCount !== b.totalIssueCount) {
|
|
49
|
+
return a.totalIssueCount - b.totalIssueCount;
|
|
50
|
+
}
|
|
51
|
+
return a.id.localeCompare(b.id);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const failedCriteria = sortedCriteria.filter(criteria =>
|
|
55
|
+
wcagViolations.some(v => formatWcagId(v) === criteria.id),
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const cardElement = document.getElementById('prioritiseIssuesCard');
|
|
59
|
+
if (failedCriteria.length === 0) {
|
|
60
|
+
if (cardElement) {
|
|
61
|
+
cardElement.style.display = 'none';
|
|
62
|
+
}
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const accordionContainer = document.getElementById('prioritiseIssuesAccordion');
|
|
67
|
+
if (!accordionContainer) return;
|
|
68
|
+
|
|
69
|
+
const accordionHTML = failedCriteria
|
|
70
|
+
.map((criteria, index) => {
|
|
71
|
+
const wcagScore = criteria.id.replace('WCAG ', '');
|
|
72
|
+
const issueWord = criteria.issues.length === 1 ? 'issue' : 'issues';
|
|
73
|
+
|
|
74
|
+
const issuesListHTML = criteria.issues
|
|
75
|
+
.map(issue => {
|
|
76
|
+
const disabilities = disabilityBadgesMap[issue.ruleId] || [];
|
|
77
|
+
const disabilityBadges =
|
|
78
|
+
disabilities.length > 0
|
|
79
|
+
? `
|
|
80
|
+
<div class="priority-issue-badges">
|
|
81
|
+
${disabilities.map(disability => `<span class="disability-badge">${disability} Disability</span>`).join('')}
|
|
82
|
+
</div>
|
|
83
|
+
`
|
|
84
|
+
: '';
|
|
85
|
+
|
|
86
|
+
return `
|
|
87
|
+
<li class="priority-issue-item d-flex g-one" data-rule-id="${issue.ruleId}" role="button" tabindex="0">
|
|
88
|
+
<div class="d-flex justify-content-between align-items-center w-90">
|
|
89
|
+
<div class="priority-issue-title">${issue.description}</div>
|
|
90
|
+
${disabilityBadges}
|
|
91
|
+
</div>
|
|
92
|
+
</li>
|
|
93
|
+
`;
|
|
94
|
+
})
|
|
95
|
+
.join('');
|
|
96
|
+
|
|
97
|
+
return `
|
|
98
|
+
<div class="accordion-item">
|
|
99
|
+
<h3 class="accordion-header" id="heading${index}">
|
|
100
|
+
<button
|
|
101
|
+
class="accordion-button collapsed"
|
|
102
|
+
type="button"
|
|
103
|
+
data-bs-toggle="collapse"
|
|
104
|
+
data-bs-target="#collapse${index}"
|
|
105
|
+
aria-expanded="false"
|
|
106
|
+
aria-controls="collapse${index}"
|
|
107
|
+
>
|
|
108
|
+
<span class="h4 mb-0">WCAG ${wcagScore} - </span>
|
|
109
|
+
<span class="h4 fw-normal mb-0">${criteria.issues.length} ${issueWord}</span>
|
|
110
|
+
<span class="wcag-score-badge">-1 WCAG Score</span>
|
|
111
|
+
<svg class="accordion-icon-collapsed" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
112
|
+
<path d="M7.41 8.58984L12 13.1698L16.59 8.58984L18 9.99984L12 15.9998L6 9.99984L7.41 8.58984Z" fill="#5735DF"/>
|
|
113
|
+
</svg>
|
|
114
|
+
<svg class="accordion-icon-expanded" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
115
|
+
<path d="M7.41 15.4102L12 10.8302L16.59 15.4102L18 14.0002L12 8.00016L6 14.0002L7.41 15.4102Z" fill="#5735DF"/>
|
|
116
|
+
</svg>
|
|
117
|
+
</button>
|
|
118
|
+
</h3>
|
|
119
|
+
<div
|
|
120
|
+
id="collapse${index}"
|
|
121
|
+
class="accordion-collapse collapse"
|
|
122
|
+
data-bs-parent="#prioritiseIssuesAccordion"
|
|
123
|
+
>
|
|
124
|
+
<div class="accordion-body">
|
|
125
|
+
<ul class="priority-issues-list">
|
|
126
|
+
${issuesListHTML}
|
|
127
|
+
</ul>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
`;
|
|
132
|
+
})
|
|
133
|
+
.join('');
|
|
134
|
+
|
|
135
|
+
accordionContainer.innerHTML = accordionHTML;
|
|
136
|
+
|
|
137
|
+
document.querySelectorAll('.priority-issue-item').forEach(item => {
|
|
138
|
+
const selectIssue = function () {
|
|
139
|
+
const ruleId = item.getAttribute('data-rule-id');
|
|
140
|
+
|
|
141
|
+
document.querySelectorAll('.priority-issue-item').forEach(el => {
|
|
142
|
+
el.classList.remove('active');
|
|
143
|
+
el.setAttribute('aria-selected', 'false');
|
|
144
|
+
});
|
|
145
|
+
document.querySelectorAll('.priority-issue-title').forEach(el => {
|
|
146
|
+
el.classList.remove('active');
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
item.classList.add('active');
|
|
150
|
+
item.setAttribute('aria-selected', 'true');
|
|
151
|
+
const title = item.querySelector('.priority-issue-title');
|
|
152
|
+
if (title) {
|
|
153
|
+
title.classList.add('active');
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
let selectedRule = null;
|
|
157
|
+
for (const criteria of failedCriteria) {
|
|
158
|
+
const issue = criteria.issues.find(i => i.ruleId === ruleId);
|
|
159
|
+
if (issue) {
|
|
160
|
+
selectedRule = issue;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (selectedRule && typeof window.populateIssueDetailCard === 'function') {
|
|
166
|
+
window.populateIssueDetailCard(selectedRule);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// Click handler
|
|
171
|
+
item.addEventListener('click', selectIssue);
|
|
172
|
+
|
|
173
|
+
// Keyboard handler
|
|
174
|
+
item.addEventListener('keydown', function (event) {
|
|
175
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
176
|
+
event.preventDefault();
|
|
177
|
+
selectIssue();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// Automatically open first accordion and select first issue
|
|
183
|
+
if (failedCriteria.length > 0 && failedCriteria[0].issues.length > 0) {
|
|
184
|
+
const firstAccordionButton = document.querySelector(
|
|
185
|
+
'#prioritiseIssuesAccordion .accordion-button',
|
|
186
|
+
);
|
|
187
|
+
const firstAccordionCollapse = document.querySelector(
|
|
188
|
+
'#prioritiseIssuesAccordion .accordion-collapse',
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
if (firstAccordionButton && firstAccordionCollapse) {
|
|
192
|
+
firstAccordionButton.classList.remove('collapsed');
|
|
193
|
+
firstAccordionButton.setAttribute('aria-expanded', 'true');
|
|
194
|
+
firstAccordionCollapse.classList.add('show');
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const firstIssueItem = document.querySelector('.priority-issue-item');
|
|
198
|
+
if (firstIssueItem) {
|
|
199
|
+
firstIssueItem.classList.add('active');
|
|
200
|
+
firstIssueItem.setAttribute('aria-selected', 'true');
|
|
201
|
+
const firstIssueTitle = firstIssueItem.querySelector('.priority-issue-title');
|
|
202
|
+
if (firstIssueTitle) {
|
|
203
|
+
firstIssueTitle.classList.add('active');
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const firstIssue = failedCriteria[0].issues[0];
|
|
207
|
+
|
|
208
|
+
if (typeof window.populateIssueDetailCard === 'function') {
|
|
209
|
+
window.populateIssueDetailCard(firstIssue);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
})();
|
|
214
|
+
</script>
|