a11y-outline

web extension to navigate document outlines easily
git clone https://git.ce9e.org/a11y-outline.git

commit
0884300434ab1075fa09007b6a28e722d9113005
parent
2d84fa81bb1ef1f8454673d1f1d2d9fb36262cd6
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-10-11 06:24
lint

Diffstat

M outline.js 12 +++++++-----

1 files changed, 7 insertions, 5 deletions


diff --git a/outline.js b/outline.js

@@ -1,3 +1,5 @@
   -1     1 /* global chrome, aria, treeview */
   -1     2 
    1     3 var DIALOG_ID = 'a11y-outline';
    2     4 
    3     5 var focus = function(el) {
@@ -38,7 +40,7 @@ var createItem = function(el, i) {
   38    40 		label: label,
   39    41 		href: '#' + i,
   40    42 		children: [],
   41    -1 		element: el
   -1    43 		element: el,
   42    44 	};
   43    45 };
   44    46 
@@ -112,7 +114,7 @@ var quickNav = function() {
  112   114 		'<option value="landmark">Landmarks</option>' +
  113   115 		'<option value="heading">Headings</option>' +
  114   116 		'<option value="link">Links</option>';
  115    -1 	select.addEventListener('change', function(event) {
   -1   117 	select.addEventListener('change', function() {
  116   118 		updateVisiblePane(select, dialog);
  117   119 	});
  118   120 	select.autofocus = true;
@@ -173,7 +175,7 @@ var focusNext = function(selector) {
  173   175 	if (target) {
  174   176 		focus(target);
  175   177 	}
  176    -1 }
   -1   178 };
  177   179 
  178   180 var focusPrev = function(selector) {
  179   181 	var target;
@@ -187,9 +189,9 @@ var focusPrev = function(selector) {
  187   189 	if (target) {
  188   190 		focus(target);
  189   191 	}
  190    -1 }
   -1   192 };
  191   193 
  192    -1 chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
   -1   194 chrome.runtime.onMessage.addListener(function(request) {
  193   195 	if (document.getElementById(DIALOG_ID)) {
  194   196 		return;
  195   197 	} else if (request === 'showA11yOutline') {