Skip to content

Commit

Permalink
refactor(checkalts): modernize and improve alt reporter with MV3
Browse files Browse the repository at this point in the history
  • Loading branch information
ffoodd committed Jun 12, 2023
1 parent f5e2958 commit 7893313
Show file tree
Hide file tree
Showing 18 changed files with 407 additions and 393 deletions.
15 changes: 12 additions & 3 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"altMissing": {
"message": "missing"
},
"altOK": {
"message": "OK"
},
"localizeOn": {
"message": "On"
},
Expand Down Expand Up @@ -58,5 +55,17 @@
},
"h1Others": {
"message": "Other tools"
},
"scrollToImage": {
"message": "Scroll to image"
},
"checkAltsHeading": {
"message": "$NUMBER$ images",
"placeholders": {
"number": {
"content": "$1",
"example": "6"
}
}
}
}
15 changes: 12 additions & 3 deletions _locales/es/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"altMissing": {
"message": "falta"
},
"altOK": {
"message": "OK"
},
"localizeOn": {
"message": "On"
},
Expand Down Expand Up @@ -58,5 +55,17 @@
},
"h1Others": {
"message": "Otras herramientas"
},
"scrollToImage": {
"message": "Desplácese hasta la imagen"
},
"checkAltsHeading": {
"message": "$NUMBER$ imágenes",
"placeholders": {
"number": {
"content": "$1",
"example": "6"
}
}
}
}
15 changes: 12 additions & 3 deletions _locales/fr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"altMissing": {
"message": "manquant"
},
"altOK": {
"message": "OK"
},
"localizeOn": {
"message": "Activé"
},
Expand Down Expand Up @@ -58,5 +55,17 @@
},
"h1Others": {
"message": "Autres outils"
},
"scrollToImage": {
"message": "Défiler vers l’image"
},
"checkAltsHeading": {
"message": "$NUMBER$ images",
"placeholders": {
"number": {
"content": "$1",
"example": "6"
}
}
}
}
15 changes: 12 additions & 3 deletions _locales/gr/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"altMissing": {
"message": "λείπει"
},
"altOK": {
"message": "OK"
},
"localizeOn": {
"message": "Ενεργοποιημένη"
},
Expand Down Expand Up @@ -58,5 +55,17 @@
},
"h1Others": {
"message": "Άλλα εργαλεία"
},
"scrollToImage": {
"message": "Μετακινηθείτε στην εικόνα"
},
"checkAltsHeading": {
"message": "$NUMBER$ εικόνες",
"placeholders": {
"number": {
"content": "$1",
"example": "6"
}
}
}
}
15 changes: 12 additions & 3 deletions _locales/pl/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"altMissing": {
"message": "brak"
},
"altOK": {
"message": "OK"
},
"localizeOn": {
"message": "Wł."
},
Expand Down Expand Up @@ -58,5 +55,17 @@
},
"h1Others": {
"message": "Inne narzędzia"
},
"scrollToImage": {
"message": "Przewiń do obrazu"
},
"checkAltsHeading": {
"message": "$NUMBER$ obrazów",
"placeholders": {
"number": {
"content": "$1",
"example": "6"
}
}
}
}
15 changes: 12 additions & 3 deletions _locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"altMissing": {
"message": "отсутствует"
},
"altOK": {
"message": "OK"
},
"localizeOn": {
"message": "Вкл"
},
Expand Down Expand Up @@ -58,5 +55,17 @@
},
"h1Others": {
"message": "Другие инструменты"
},
"scrollToImage": {
"message": "Прокрутите изображение"
},
"checkAltsHeading": {
"message": "$NUMBER$ изображений",
"placeholders": {
"number": {
"content": "$1",
"example": "6"
}
}
}
}
2 changes: 1 addition & 1 deletion icons/info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/ko.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/ok.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions manifest-chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
"content_scripts": [
{
"matches": [
"<all_urls>"
"*://*/*"
],
"js": [
"/scripts/injected/checkalts.js"
],
"css": [
"/scripts/injected/checkalts.css"
],
"run_at": "document_end"
}
],
Expand All @@ -44,9 +47,9 @@
"icons/info.svg",
"icons/ko.svg",
"icons/ok.svg",
"scripts/injected/checkalts.js",
"scripts/injected/*",
"css/*"
],
"matches": ["<all_urls>"]
"matches": ["*://*/*"]
}]
}
9 changes: 6 additions & 3 deletions manifest-firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@
"content_scripts": [
{
"matches": [
"<all_urls>"
"*://*/*"
],
"js": [
"/scripts/injected/checkalts.js"
],
"css": [
"/scripts/injected/checkalts.css"
],
"run_at": "document_end"
}
],
Expand All @@ -51,11 +54,11 @@
"icons/info.svg",
"icons/ko.svg",
"icons/ok.svg",
"scripts/injected/checkalts.js",
"scripts/injected/*",
"css/*"
],
"matches": [
"<all_urls>"
"*://*/*"
]
}
]
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"stylelint": {
"extends": "stylelint-config-standard-scss",
"rules": {
"indentation": "tab",
"string-quotes": null,
"at-rule-empty-line-before": null,
"declaration-empty-line-before": null,
Expand Down
56 changes: 28 additions & 28 deletions popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,71 +8,71 @@
</head>
<body>
<main id="home">
<h1 data-message="h1Allycss" class="localizeMe"></h1>
<h1 data-message="h1Allycss" class="localize"></h1>

<form id="a11ycssForm" class="util">
<form id="a11ycssForm" class="m-1">
<fieldset class="input-group">
<legend><h2 data-message="a11ycssMinimumNoticeLevel" class="localizeMe"></h2></legend>
<legend><h2 data-message="a11ycssMinimumNoticeLevel" class="localize"></h2></legend>
<div class="radiocontainer">
<input type="radio" name="option-a11y" id="a11ycss1" value="all" checked class="sr-only">
<label for="a11ycss1" data-message="a11ycssLevel_all" class="localizeMe"></label>
<input type="radio" name="option-a11y" id="a11ycss1" value="all" checked class="visually-hidden">
<label for="a11ycss1" data-message="a11ycssLevel_all" class="localize"></label>
</div>
<div class="radiocontainer">
<input type="radio" name="option-a11y" id="a11ycss2" value="obsolete" class="sr-only">
<label for="a11ycss2" data-message="a11ycssLevel_obsolete" class="localizeMe"></label>
<input type="radio" name="option-a11y" id="a11ycss2" value="obsolete" class="visually-hidden">
<label for="a11ycss2" data-message="a11ycssLevel_obsolete" class="localize"></label>
</div>
<div class="radiocontainer">
<input type="radio" name="option-a11y" id="a11ycss3" value="warning" class="sr-only">
<label for="a11ycss3" data-message="a11ycssLevel_warning" class="localizeMe"></label>
<input type="radio" name="option-a11y" id="a11ycss3" value="warning" class="visually-hidden">
<label for="a11ycss3" data-message="a11ycssLevel_warning" class="localize"></label>
</div>
<div class="radiocontainer">
<input type="radio" name="option-a11y" id="a11ycss4" value="error" class="sr-only">
<label for="a11ycss4" data-message="a11ycssLevel_error" class="localizeMe"></label>
<input type="radio" name="option-a11y" id="a11ycss4" value="error" class="visually-hidden">
<label for="a11ycss4" data-message="a11ycssLevel_error" class="localize"></label>
</div>
</fieldset>

<p class="button-group">
<span data-message="btn_a11y_label" id="btn_a11y_label" class="localizeMe sr-only"></span>
<span data-message="btn_a11y_label" id="btn_a11y_label" class="localize visually-hidden"></span>
<button type="button" id="btn-a11y" role="switch"
aria-checked="false" aria-labelledby="btn_a11y_label">
<span data-message="a11ycssBtnClear" class="localizeMe unapply"></span>
<span data-message="a11ycssBtnApply" class="localizeMe apply"></span>
<span data-message="a11ycssBtnClear" class="localize unapply"></span>
<span data-message="a11ycssBtnApply" class="localize apply"></span>
</button>
</p>
</form>

<div class="util">
<h2 data-message="h1Others" class="localizeMe"></h2>
<div class="m-1">
<h2 data-message="h1Others" class="localize"></h2>
<p class="button-group">
<span data-message="btn_outline_label" id="btn_outline_label" class="localizeMe"></span>
<span data-message="btn_outline_label" id="btn_outline_label" class="localize"></span>
<button type="button" id="btn-outline" role="switch"
aria-checked="false" aria-labelledby="btn_outline_label">
<span data-message="localizeOn" class="localizeMe"></span>
<span data-message="localizeOff" class="localizeMe"></span>
<span data-message="localizeOn" class="localize"></span>
<span data-message="localizeOff" class="localize"></span>
</button>
</p>
<p class="button-group">
<span data-message="btn_lang_label" id="btn_lang_label" class="localizeMe"></span>
<span data-message="btn_lang_label" id="btn_lang_label" class="localize"></span>
<button type="button" id="btn-lang" role="switch"
aria-checked="false" aria-labelledby="btn_lang_label">
<span data-message="localizeOn" class="localizeMe"></span>
<span data-message="localizeOff" class="localizeMe"></span>
<span data-message="localizeOn" class="localize"></span>
<span data-message="localizeOff" class="localize"></span>
</button>
</p>
<p class="button-group">
<span data-message="btn_alt_label" id="btn_alt_label" class="localizeMe"></span>
<span data-message="btn_alt_label" id="btn_alt_label" class="localize"></span>
<button type="button" id="btn-alt" role="switch"
aria-checked="false" aria-labelledby="btn_alt_label">
<span data-message="localizeOn" class="localizeMe"></span>
<span data-message="localizeOff" class="localizeMe"></span>
<span data-message="localizeOn" class="localize"></span>
<span data-message="localizeOff" class="localize"></span>
</button>
</p>
<p class="button-group">
<span data-message="btn_spacing_label" id="btn_spacing_label" class="localizeMe"></span>
<span data-message="btn_spacing_label" id="btn_spacing_label" class="localize"></span>
<button type="button" id="btn-spacing" role="switch"
aria-checked="false" aria-labelledby="btn_spacing_label">
<span data-message="localizeOn" class="localizeMe"></span>
<span data-message="localizeOff" class="localizeMe"></span>
<span data-message="localizeOn" class="localize"></span>
<span data-message="localizeOff" class="localize"></span>
</button>
</p>
</div>
Expand Down
Loading

0 comments on commit 7893313

Please sign in to comment.