From 5bde6a610be98736621666a9723d58b34e9a7bc6 Mon Sep 17 00:00:00 2001 From: ErickR <62436670+ErickRenteria@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:40:01 -0500 Subject: [PATCH] Revert "feature(extension) Element on web page shown when user selects an issue" --- .../contentScripts/images/NeedsReview16.svg | 25 ---- .../images/Recommendation16.svg | 15 --- .../ts/contentScripts/images/Violation16.svg | 13 -- .../src/ts/contentScripts/viewInspect.ts | 117 ++---------------- 4 files changed, 12 insertions(+), 158 deletions(-) delete mode 100644 accessibility-checker-extension/src/ts/contentScripts/images/NeedsReview16.svg delete mode 100644 accessibility-checker-extension/src/ts/contentScripts/images/Recommendation16.svg delete mode 100644 accessibility-checker-extension/src/ts/contentScripts/images/Violation16.svg diff --git a/accessibility-checker-extension/src/ts/contentScripts/images/NeedsReview16.svg b/accessibility-checker-extension/src/ts/contentScripts/images/NeedsReview16.svg deleted file mode 100644 index 60107684b..000000000 --- a/accessibility-checker-extension/src/ts/contentScripts/images/NeedsReview16.svg +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/accessibility-checker-extension/src/ts/contentScripts/images/Recommendation16.svg b/accessibility-checker-extension/src/ts/contentScripts/images/Recommendation16.svg deleted file mode 100644 index 5e68da929..000000000 --- a/accessibility-checker-extension/src/ts/contentScripts/images/Recommendation16.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - -i - diff --git a/accessibility-checker-extension/src/ts/contentScripts/images/Violation16.svg b/accessibility-checker-extension/src/ts/contentScripts/images/Violation16.svg deleted file mode 100644 index 4ce8e754d..000000000 --- a/accessibility-checker-extension/src/ts/contentScripts/images/Violation16.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - diff --git a/accessibility-checker-extension/src/ts/contentScripts/viewInspect.ts b/accessibility-checker-extension/src/ts/contentScripts/viewInspect.ts index 55de50551..0f24e40ee 100644 --- a/accessibility-checker-extension/src/ts/contentScripts/viewInspect.ts +++ b/accessibility-checker-extension/src/ts/contentScripts/viewInspect.ts @@ -27,7 +27,6 @@ type Overlays = { elem: HTMLDivElement, info: HTMLDivElement }; let devtoolsController = getDevtoolsController(true, "remote", myTabId); function getOverlays() : Overlays { - console.log("JOHO: func getOverlays"); if (!(window as any).aceOverlays) { let overlays = (window as any).aceOverlays = { elem: document.createElement("div"), @@ -38,12 +37,13 @@ type Overlays = { elem: HTMLDivElement, info: HTMLDivElement }; ovElemStyle.outline = "solid #8A3FFC 3px"; ovElemStyle.position = "absolute"; ovElemStyle.zIndex = "2147483647"; + // ovElemStyle.backgroundColor = "rgba(246, 242, 255, .5)" let ovInfoStyle = overlays.info.style; ovInfoStyle.display = "none"; - ovInfoStyle.backgroundColor = "#161616"; + ovInfoStyle.outline = "dashed #8A3FFC 2px"; + ovInfoStyle.backgroundColor = "#F6F2FF"; ovInfoStyle.position = "absolute"; ovInfoStyle.padding = "8px"; - ovInfoStyle.marginTop = "3px"; ovInfoStyle.zIndex = "2147483647"; ovInfoStyle.fontFamily = "'IBM Plex Sans', system-ui, -apple-system, BlinkMacSystemFont, '.SFNSText-Regular', sans-serif"; } @@ -58,108 +58,18 @@ type Overlays = { elem: HTMLDivElement, info: HTMLDivElement }; overlays.elem.style.height = `${bounds.height}px`; overlays.info.style.top = `${bounds.top+bounds.height}px`; overlays.info.style.left = `${bounds.left}px`; - // Get Issue info data - let report = await devtoolsController.getReport(); - let types = [0,0,0]; - console.log("report: ",report); - // Find Issues that match issue.path.dom - report?.results.map((result: IIssue) => { - if (issue.path.dom === result.path.dom) { - if (result.value[0] === "VIOLATION" && result.value[1] === "FAIL") { - types[0] += 1; - console.log("Violation"); - } - if (result.value[0] === "VIOLATION" && (result.value[1] === "POTENTIAL" || result.value[1] === "MANUAL")) { - types[1] += 1; - console.log("NR"); - } - if (result.value[0] === "RECOMMENDATION") { - types[2] += 1; - console.log("Recommendation"); - } - } - }); - // build content for issues info - let violationText = ""; // violation icon image + text - let nrText = ""; - let recommendationText = ""; - - violationText = types[0] < 2 ? types[0]+" Violation
" : types[0]+" Violations
"; - let violationImage = ` - Violation - - - - - ` - let violationImageText = violationImage + "  "; - - nrText = types[1] < 2 ? types[1]+" Needs review
" : types[1]+" Needs review
"; - let nrImage = ` - - - - - - - - - - - - - - - - - ` - let nrImageText = nrImage + " "; - - recommendationText = types[2] < 2 ? types[2]+" Recommendation" : types[1]+" Recommendations"; - let recommendationImage = ` - - - - i - ` - let recommendationImageText = recommendationImage + "  "; - - let typesText = (types[0] == 0 ? "" : "" + violationImageText + violationText + "") - + (types[1] == 0 ? "" : "" + nrImageText + nrText + "" + recommendationImageText + recommendationText + ""); - //-------------------------------------------- if (await devtoolsController.getActivePanel() === "main") { overlays.info.innerHTML = ( - ` -
- ${typesText} -
- `); +` +
Issue info here
+
+
+`); } else { overlays.info.innerHTML = ( - ` -
- ${typesText} -
- `); +` +
Issue info here
+`); } overlays.info.querySelector("a")?.addEventListener("click", async () => { await devtoolsController.inspectPath(issue.path.dom); @@ -170,8 +80,6 @@ type Overlays = { elem: HTMLDivElement, info: HTMLDivElement }; async function showOverlay(issue: IIssue) { let elem = DomPathUtils.domPathToElem(issue.path.dom); - console.log("element = ",elem); - console.log("issue =",issue); if (elem) { let bounds = ElementUtils.getBounds(elem, false); if (bounds) { @@ -205,8 +113,7 @@ type Overlays = { elem: HTMLDivElement, info: HTMLDivElement }; } devtoolsController.addSelectedIssueListener(async (issue: IIssue) => { - if (true && issue) { - console.log("issue: ",issue); + if (false && issue) { showOverlay(issue); } });