ranbuch / accessibility

add accessibility to your website
MIT License
291 stars 39 forks source link

Suggestion to add 2 important features #28

Closed nirbal closed 1 year ago

nirbal commented 2 years ago

To my point of view, the plugin is missing 2 important features in menu that regulators follow them :

  1. Area with button to redirect to Accesibilty Disclaimer URL that site owner publish.
  2. Mailto button for reporting to site owner on accesibilty issue
rtgfxp commented 2 years ago

could these fields be added in the future?

ranbuch commented 2 years ago

I think we can add custom buttons. The developer will be able to determine the text on the button and catch the click event.

@nirbal @rtgfxp WDYT?

rtgfxp commented 2 years ago

Sounds good, we need to redirect to the accessibility disclaimer (link URL) and contact page.

nirbal commented 2 years ago

Seems good solution

ranbuch commented 1 year ago

@nirbal @rtgfxp I've added an option to add buttons that wiil open a model with an iframe. You can use it as follows:

new Accessibility({
        iframeModals: [{
          buttonText: '[button text here]',
          iframeUrl: '[Iframe URL here]',
          icon: 'policy',
          emoji: '⚖️'
        }]
});

You can use other icon values from here and other emojis. In case you are using the default icons it will use the material design "icon" parameter, otherwise it will fallback to the emoji parameter.

Hoping to do the custom buttons sometimes soon.

rtgfxp commented 1 year ago

Works great, good job! @ranbuch

ranbuch commented 1 year ago

@rtgfxp Also added the custom functions feature:

new Accessibility({
        customFunctions: [{
          method: (cf, state) => {
            console.log(cf, state);
          },
          buttonText: 'foo',
          id: 1,
          toggle: true,
          icon: 'psychology_alt',
          emoji: '❓'
        }]
});

Same behavior for the icons values as the iframeModals feature. Closing this issue but fill free to open another one in case something is not working as expected.

Thanks for your patience.