Orange-OpenSource / Orange-Confort-plus

The target of Orange Confort+ functionalities is to enhance user experience on web sites, which are already accessible, or still accessible. Orange Confort+ provides these services : Typography - user may change: font size, space between words, characters and lines, font-face to Open Dislexic Layout: cancel layout, text align left, numbering list items, modify navigation links appereance, disply a reading ruler Colors : Modify foreground/background colors Behavior: direct access to main content on page load, automatic selection of page clickable elements with a user defined delay, page scrolling on simple user on hover. Be careful, Orange Confort+ does not improve the accessibility level of a web site: blocking points still stay blocking points, with or without Orange Confort+.
https://confort-plus.orange.com/
GNU General Public License v2.0
40 stars 24 forks source link

Feature request: dynamic variables #232

Closed RavanH closed 3 months ago

RavanH commented 3 months ago

Hi, working to work the Orange Confort plus script into a WordPress plugin (to be published on WordPress.org if you allow me) I would like to be able to assign certain variables like hebergementDomaine and hebergementFullPath in the root HTML. Editing the script file is not an option because these values depend on the site and WordPress installation.

A basic front-end integration, with dynamic variables, could look like this:

<script>
var hebergementDomaine = 'https://dev.status301.com'; // Your website origin, depending in site.
var hebergementFullPath = hebergementDomaine+'/wp-content/plugins/orangeconfortplus'; // Path to Confort+ folder, depending on WP install.
</script>
<script type="text/javascript" src="/wp-content/plugins/orangeconfortplus/js/toolbar.min.js?ver=123"></script>

To make this work, the main toolbar script would need some minor changes.

I would suggest to either NOT include the variable attributions for hebergementDomaine, hebergementFullPath, imagesPath, helpPath, uci_classic_toolbar_css and onOffEnabled in the main script at all, or allow them to be overwritten like this:

var hebergementDomaine = hebergementDomaine || window.location.origin;
var hebergementFullPath = hebergementFullPath || hebergementDomaine + '/';
var imagesPath = imagesPath || {
    arrows: hebergementFullPath + "img/arrows_60.png"
};
var helpPath = helpPath || {
    FR: hebergementFullPath + "help/help_fr.html",
    EN: hebergementFullPath + "help/help_en.html",
    ES: hebergementFullPath + "help/help_es.html",
    PL: hebergementFullPath + "help/help_pl.html"
};
var uci_classic_toolbar_css = uci_classic_toolbar_css || hebergementFullPath + 'css/classic-toolbar.css';
var onOffEnabled = onOffEnabled ?? true;
ffoodd commented 3 months ago

That's an easy fix so let's do it.

However be aware that the current production release will not evolve anymore, as we're working on the next major release for months now.

Regarding embedding Confort+ in a WordPress plugin, you must conform to GNU GPL v2.0 and you cannot use Orange's logo nor brand.

RavanH commented 3 months ago

@ffoodd thanks for letting me know. Complying to GPL 2 (or 3) is a requirement for WordPress as well so that's no problem.

The next major release, is that the one in the development branch? I see it is not using the old variables anymore, but the documentation has not been updated yet.

When would you estimate it being ready for production? If soon, then I might as well start with the new release in the WordPress plugin instead of the current...

RavanH commented 3 months ago

That's an easy fix so let's do it.

No need, if the new release is going to be so different anyway.

ffoodd commented 3 months ago

There are still tons of things to do with the next major (including documentation), so don't expect it before a few months…

That's why I'm trying some patches on the current release, if that can help in any case.

RavanH commented 3 months ago

Prefect. I'll be working with the current stable to start with then. I'll keep you posted :)