diff --git a/VERSIONS_WIP/197469 b/VERSIONS_WIP/197469 new file mode 100644 index 0000000000000000000000000000000000000000..76653fa26d93b5e7a5787fed9dd08338c89a35ba --- /dev/null +++ b/VERSIONS_WIP/197469 @@ -0,0 +1 @@ + - correctif #197469 : Boite accessibilité : correction de l'affichage du bouton en mode popup. \ No newline at end of file diff --git a/public/opac/js/access_config/css/accessconfig.css b/public/opac/js/access_config/css/accessconfig.css index 7356ab3b3b4d8a489c35d1bf1016dd16a5e3d0a8..87cadfe0d9b1a30271796c3faa56d4901bdca2f2 100755 --- a/public/opac/js/access_config/css/accessconfig.css +++ b/public/opac/js/access_config/css/accessconfig.css @@ -197,7 +197,7 @@ } #a42-ac-button { - background: url(/skins/skin-skel/access_config/images/eye-low-vision-solid.png) no-repeat; + background: url(../images/eye-low-vision-solid.png) no-repeat; background-size: auto 80%; color: transparent !important; height: 30px; diff --git a/public/opac/js/access_config/css/accessconfig.min.css b/public/opac/js/access_config/css/accessconfig.min.css deleted file mode 100755 index 46601d14d0f082717e37f7444a229852497afcf3..0000000000000000000000000000000000000000 --- a/public/opac/js/access_config/css/accessconfig.min.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";/*! AccessConfig | Access42 | accessconfig.a11y.fr */#a42-ac{position:fixed;z-index:9999;width:100%;top:0;right:0;bottom:0;left:0;padding:.75rem 1.5rem 1.5rem;background-color:#fff;border:1px solid #fff;overflow:auto;font-size:1rem;display:none;color:#0b1b34}@media screen and (max-width:29.9em){#a42-ac{border:0;padding:.75rem}}#a42-ac,#a42-ac *,#a42-ac ::after,#a42-ac ::before{box-sizing:border-box}@media screen and (min-width:50em){#a42-ac{width:90%;top:10%;left:50%;right:auto;bottom:auto;margin-left:-45%}}@media screen and (min-width:64em){#a42-ac{width:58.750em;margin-left:-29.375rem}}#a42-ac h1{margin:0 3rem 0 0;font-size:1.75em;line-height:1.3;color:#0b1b34}#a42-ac .sr-only{border:0!important;clip:rect(1px,1px,1px,1px)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}#a42-ac .sr-only-focusable:focus,#a42-ac .sr-only-focusable:active{clip:auto!important;-webkit-clip-path:none!important;clip-path:none!important;height:auto!important;margin:auto!important;overflow:visible!important;width:auto!important;white-space:normal!important}#a42-ac-close{position:absolute;top:1.5rem;right:1.5rem;width:1.5rem;height:1.5rem;cursor:pointer;border:0}#a42-ac-close,#a42-ac #a42-ac-close{overflow:hidden}#a42-ac-close::after{content:'';position:absolute;top:0;left:50%;display:block;margin-left:-.75rem;width:1.5rem;height:1.5rem;background:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjQgNC4yLTQuMS00LjFoLS4xbC03LjggNy43LTcuOC03LjhoLS4xbC00LjEgNC4xIDcuOSA3LjktNy45IDcuOCA0LjEgNC4yaC4xbDcuOC03LjggNy44IDcuN2MwIC4xIDAgLjEuMSAwbDQuMS00LjEtNy44LTcuOHoiIGZpbGw9IiMzMTQ4NmUiLz48L3N2Zz4=) no-repeat 50% 50%}#a42-ac-close:hover,#a42-ac-close:focus,#a42-ac-close:active{opacity:.6;background-color:transparent!important}#a42-ac button,#a42-ac input,#a42-ac optgroup,#a42-ac select,#a42-ac textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}#a42-ac button,#a42-ac input{overflow:visible}#a42-ac button,#a42-ac select{text-transform:none}#a42-ac button,#a42-ac [type=button],#a42-ac [type=submit]{-webkit-appearance:button}#a42-ac button::-moz-focus-inner,#a42-ac [type=button]::-moz-focus-inner,#a42-ac [type=reset]::-moz-focus-inner,#a42-ac [type=submit]::-moz-focus-inner{border-style:none;padding:0}#a42-ac button:-moz-focusring,#a42-ac [type=button]:-moz-focusring,#a42-ac [type=reset]:-moz-focusring,#a42-ac [type=submit]:-moz-focusring{outline:1px dotted ButtonText}#a42-ac legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}#a42-ac [type=checkbox],#a42-ac [type=radio]{box-sizing:border-box;padding:0}#a42-ac fieldset{margin:1em 0 0;padding:1em .5em 1em 1em;border-width:0 0 0 .625em;border-style:solid;border-color:#cedae6;background-color:#e3ebf2}@media screen and (min-width:50em){#a42-ac .a42-ac-content{display:flex;align-items:flex-start;flex-wrap:wrap}#a42-ac fieldset{width:45%;width:calc(50% - .5em);align-self:stretch}#a42-ac fieldset:nth-child(odd){clear:left;margin-right:.5em}#a42-ac fieldset:nth-child(even){margin-left:.5em}}@media screen and (max-width:29.9em){#a42-ac fieldset{font-size:.875em;padding:.5em;border-left-width:.357em}}#a42-ac legend{float:left;width:100%;margin:0;padding-bottom:.364em;font-weight:700;font-size:1.375em;color:#0b1b34}#a42-ac legend+:first-child{clear:left}#a42-ac label{margin:0 1em .533em .5em;padding-top:.067em;padding-bottom:.067em;font-size:.938em;line-height:1.6}#a42-ac input[type=radio]{border:0!important;clip:rect(1px,1px,1px,1px)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;height:1px!important;margin:-1px!important;overflow:hidden!important;padding:0!important;position:absolute!important;width:1px!important;white-space:nowrap!important}#a42-ac input[type=radio]+label{position:relative;display:inline-block;vertical-align:middle;margin-left:0;padding-left:2.267em}#a42-ac input[type=radio]+label::after,#a42-ac input[type=radio]+label::before{content:'';position:absolute;display:block;border-radius:100%}#a42-ac input[type=radio]+label::after{top:.33334em;left:.33334em;width:.933em;height:.933em;transition:all .2s;background-color:#31486e}#a42-ac input[type=radio]+label::before{top:0;left:0;width:1.6em;height:1.6em;border-width:.2em;border-style:solid;border-color:#a0b0bd;background-color:#f9fcff}@media screen and (max-width:29.9em){#a42-ac input[type=radio]+label::after{top:.357em;left:.357em;width:1em;height:1em}#a42-ac input[type=radio]+label::before{width:1.714em;height:1.714em}}#a42-ac input[type=radio]:focus+label{outline:1px dotted}#a42-ac input[type=radio]:checked+label::before{border-color:#31486e}#a42-ac input[type=radio]:not(:checked)+label::after{opacity:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0)}#a42-ac input[type=radio]:disabled+label{opacity:.5}#a42-ac input[type=radio]:disabled+label:hover{cursor:not-allowed}body.a42-ac-active{overflow:hidden}.a42-ac-overlay{position:fixed;top:0;left:0;height:100%;width:100%;background-color:rgba(11,27,52,.8);z-index:998;display:none}.a42-ac-active .a42-ac-overlay{display:block}.a42-ac-inv-contrast .a42-ac-overlay{background-color:rgba(0,13,99,.8)!important}.a42-ac-high-contrast .a42-ac-overlay{background-color:rgba(32,33,41,.8)!important}.a42-ac-high-contrast *,.a42-ac-inv-contrast *,.a42-ac-high-contrast ::after,.a42-ac-inv-contrast ::after,.a42-ac-high-contrast ::before,.a42-ac-inv-contrast ::before{border-image:none!important;text-shadow:none!important}.a42-ac-high-contrast path,.a42-ac-high-contrast polygon,.a42-ac-high-contrast svg,.a42-ac-high-contrast svg *,.a42-ac-inv-contrast path,.a42-ac-inv-contrast polygon,.a42-ac-inv-contrast svg,.a42-ac-inv-contrast svg *{fill:currentColor}.a42-ac-high-contrast input,.a42-ac-high-contrast textarea,.a42-ac-high-contrast select,.a42-ac-high-contrast form button,.a42-ac-inv-contrast input,.a42-ac-inv-contrast textarea,.a42-ac-inv-contrast select,.a42-ac-inv-contrast form button{border-width:1px!important;border-style:solid!important}.a42-ac-high-contrast ::first-letter,.a42-ac-inv-contrast ::first-letter{color:inherit!important}.a42-ac-high-contrast input[type=range],.a42-ac-inv-contrast input[type=range]{border:0!important}.a42-ac-high-contrast input[type=range]::-webkit-slider-thumb,.a42-ac-inv-contrast input[type=range]::-webkit-slider-thumb{margin-top:-.25em}@supports (-ms-ime-align:auto){.a42-ac-high-contrast input[type=range]::-webkit-slider-thumb,.a42-ac-inv-contrast input[type=range]::-webkit-slider-thumb{margin-top:0}}.a42-ac-high-contrast input[type=range]::-webkit-slider-runnable-track,.a42-ac-inv-contrast input[type=range]::-webkit-slider-runnable-track{height:.313em}.a42-ac-high-contrast,.a42-ac-high-contrast *{background-color:#343643!important;color:#fff!important}.a42-ac-high-contrast,.a42-ac-high-contrast *,.a42-ac-high-contrast ::before,.a42-ac-high-contrast ::after{border-color:#fff!important}.a42-ac-high-contrast #a42-ac-close::after{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjQgNC4yLTQuMS00LjFoLS4xbC03LjggNy43LTcuOC03LjhoLS4xbC00LjEgNC4xIDcuOSA3LjktNy45IDcuOCA0LjEgNC4yaC4xbDcuOC03LjggNy44IDcuN2MwIC4xIDAgLjEuMSAwbDQuMS00LjEtNy44LTcuOHoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.a42-ac-high-contrast #a42-ac input[type=radio]+label::before{border-color:#f9fcff!important;background-color:transparent!important}.a42-ac-high-contrast #a42-ac input[type=radio]+label::after{background-color:#f9fcff!important}.a42-ac-high-contrast input,.a42-ac-high-contrast textarea,.a42-ac-high-contrast select{border-color:#f9fcff!important;color:inherit!important}.a42-ac-high-contrast ::-webkit-input-placeholder{color:#fff!important}.a42-ac-high-contrast ::-moz-placeholder{color:#fff!important;opacity:1!important}.a42-ac-high-contrast :-ms-input-placeholder{color:#fff!important}.a42-ac-high-contrast :-moz-placeholder{color:#fff!important;opacity:1!important}.a42-ac-high-contrast ::-webkit-datetime-edit-text{color:#fff!important}.a42-ac-high-contrast ::-webkit-datetime-edit-month-field{color:#fff!important}.a42-ac-high-contrast ::-webkit-datetime-edit-day-field{color:#fff!important}.a42-ac-high-contrast ::-webkit-datetime-edit-year-field{color:#fff!important}.a42-ac-high-contrast ::-webkit-calendar-picker-indicator{background:#343643!important}.a42-ac-high-contrast input[type=range]::-webkit-slider-runnable-track{background:#fff!important}.a42-ac-high-contrast input[type=range]::-moz-range-track{background:#fff!important}.a42-ac-high-contrast input[type=range]::-moz-range-thumb{background:#000!important;border:.15em solid #fff!important}.a42-ac-high-contrast input[type=range]::-ms-fill-lower{background:#fff!important}.a42-ac-high-contrast input[type=range]::-ms-fill-upper{background:#fff!important}.a42-ac-high-contrast input[type=range]:focus::-ms-fill-lower{background:#fff!important}.a42-ac-high-contrast input[type=range]:focus::-ms-fill-upper{background:#fff!important}.a42-ac-high-contrast input[type=range]::-ms-thumb{background:#000!important;border:.15em solid #fff!important}.a42-ac-inv-contrast,.a42-ac-inv-contrast *{background-color:navy!important;color:#FF0!important}.a42-ac-inv-contrast,.a42-ac-inv-contrast *,.a42-ac-inv-contrast ::before,.a42-ac-inv-contrast ::after{border-color:#FF0!important}.a42-ac-inv-contrast #a42-ac-close::after{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtMjQgNC4yLTQuMS00LjFoLS4xbC03LjggNy43LTcuOC03LjhoLS4xbC00LjEgNC4xIDcuOSA3LjktNy45IDcuOCA0LjEgNC4yaC4xbDcuOC03LjggNy44IDcuN2MwIC4xIDAgLjEuMSAwbDQuMS00LjEtNy44LTcuOHoiIGZpbGw9IiNmZjAiLz48L3N2Zz4=)}.a42-ac-inv-contrast #a42-ac input[type=radio]+label::before{border-color:#FF0!important;background-color:transparent!important}.a42-ac-inv-contrast #a42-ac input[type=radio]+label::after{background-color:#FF0!important}.a42-ac-inv-contrast input,.a42-ac-inv-contrast textarea,.a42-ac-inv-contrast select{border-color:#FF0!important}.a42-ac-inv-contrast ::-webkit-input-placeholder{color:#FF0!important}.a42-ac-inv-contrast ::-moz-placeholder{color:#FF0!important;opacity:1!important}.a42-ac-inv-contrast :-ms-input-placeholder{color:#FF0!important}.a42-ac-inv-contrast :-moz-placeholder{color:#FF0!important;opacity:1!important}.a42-ac-inv-contrast ::-webkit-datetime-edit-text{color:#FF0!important}.a42-ac-inv-contrast ::-webkit-datetime-edit-month-field{color:#FF0!important}.a42-ac-inv-contrast ::-webkit-datetime-edit-day-field{color:#FF0!important}.a42-ac-inv-contrast ::-webkit-datetime-edit-year-field{color:#FF0!important}.a42-ac-inv-contrast ::-webkit-calendar-picker-indicator{background:navy!important}.a42-ac-inv-contrast input[type=range]::-webkit-slider-runnable-track{background:#FF0!important}.a42-ac-inv-contrast input[type=range]::-moz-range-track{background:#FF0!important}.a42-ac-inv-contrast input[type=range]::-moz-range-thumb{background:navy!important;border:.15em solid #FF0!important}.a42-ac-inv-contrast input[type=range]::-ms-fill-lower{background:#FF0!important}.a42-ac-inv-contrast input[type=range]::-ms-fill-upper{background:#FF0!important}.a42-ac-inv-contrast input[type=range]:focus::-ms-fill-lower{background:#FF0!important}.a42-ac-inv-contrast input[type=range]:focus::-ms-fill-upper{background:#FF0!important}.a42-ac-inv-contrast input[type=range]::-ms-thumb{background:navy!important;border:.15em solid #FF0!important}@font-face{font-family:opendys;src:url(fonts/opendyslexic-regular-webfont.woff2) format('woff2'),url(fonts/opendyslexic-regular-webfont.woff) format('woff');font-weight:400;font-style:normal}body.a42-ac-dys-font,body.a42-ac-dys-font *{font-family:opendys!important}.a42-ac-dys-spacing,.a42-ac-dys-spacing *{line-height:1.5!important}.a42-ac-cancel-justification,.a42-ac-cancel-justification *{text-align:left!important}.a42-ac-replace-style{border:5px solid!important;padding:.2em} \ No newline at end of file diff --git a/public/opac/js/access_config/js/accessconfig.min.js b/public/opac/js/access_config/js/accessconfig.min.js deleted file mode 100755 index a5f1a9cb2249fea92f6225a47ece2fd937762d1e..0000000000000000000000000000000000000000 --- a/public/opac/js/access_config/js/accessconfig.min.js +++ /dev/null @@ -1 +0,0 @@ -var AccessConfig=function(){"use strict ";var e={Setup:{id:"accessconfig"},Setting:{useExtendContrast:!0},BodyActive:{classSetting:"active"},Overlay:{classSetting:"overlay"},ModalButton:{id:"button"},ModalContainer:{classSetting:"modal",titleLang:{en:"Accessibility setting",fr:"Paramètres d’accessibilité"},titleId:"title",titleClass:"title"},CloseButton:{id:"close",classSetting:"close",lang:{en:"close",fr:"fermer"},hiddenTextClass:"sr-only"},InlineContentContainer:{id:"inline-c"},FormFieldsetContent:{classSetting:"content"},FormFieldset:{classSetting:"fieldset"},LegendFieldset:{classSetting:"legend"},FormRadio:{classSetting:"radio"},ContrastFieldset:{id:"contrast"},ContrastLegend:{lang:{en:"Contrast",fr:"Contrastes"}},DefaultContrastCheckbox:{id:"default-contrast",value:"default-contrast",groupName:"contrast",lang:{en:"Default",fr:"Défaut"}},HighContrastCheckbox:{id:"high-contrast",value:"high-contrast",groupName:"contrast",lang:{en:"Reinforce",fr:"Renforcer"}},InvertContrastCheckbox:{id:"inv-contrast",value:"inv-contrast",groupName:"contrast",lang:{en:"Reverse",fr:"Inverser"}},DyslexiaFieldset:{id:"font"},DyslexiaLegend:{lang:{en:"Font (dyslexia)",fr:"Police (dyslexie)"}},DefaultFontCheckbox:{id:"default-font",value:"default-font",groupName:"font",lang:{en:"Default",fr:"Défaut"}},DyslexiaFontCheckbox:{id:"dys-font",value:"dys-font",groupName:"font",lang:{en:"Adapt",fr:"Adapter"}},LineSpacingFieldset:{id:"line-spacing"},LineSpacingLegend:{lang:{en:"Line spacing",fr:"Interlignage"}},DefaultLineSpacingCheckbox:{id:"default-spacing",value:"default-spacing",groupName:"line-spacing",lang:{en:"Default",fr:"Défaut"}},DyslexiaLineSpacingCheckbox:{id:"dys-spacing",value:"dys-spacing",groupName:"line-spacing",lang:{en:"Increase",fr:"Augmenter"}},JustificationFieldset:{id:"justification"},JustificationLegend:{lang:{en:"Justification",fr:"Justification"}},DefaultJustificationCheckbox:{id:"default-justification",value:"default-justification",groupName:"justification",lang:{en:"Default",fr:"Défaut"}},DyslexiaJustificationCheckbox:{id:"cancel-justification",value:"cancel-justification",groupName:"justification",lang:{en:"Remove",fr:"Supprimer"}},ImageReplacementFieldset:{id:"image"},ImageReplacementCSS:{replacementCss:"replace-img",replacementStyle:"replace-style"},ImageReplacementLegend:{lang:{en:"Images",fr:"Images"}},DefaultImageReplacementCheckbox:{id:"default-img",value:"default-img",groupName:"image",lang:{en:"Default",fr:"Défaut"}},ImageReplacementCheckbox:{id:"text-img",value:"text-img",groupName:"image",lang:{en:"Replace with text",fr:"Remplacer par du texte"}}},a={mode:null,cookieName:null,openObj:null,imgTab:null,imgSpan:null};function t(){var t=document.querySelector("body"),s=document.getElementById(a.mode).querySelectorAll("input");for(i=0,len=s.length;i<len;i++)s[i].addEventListener("click",function(){n(this)},!1);var o=function(e){for(var a=userPrefix+"-"+e+"=",t=document.cookie.split(";"),i=0;i<t.length;i++){for(var n=t[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(a))return n.substring(a.length,n.length)}return null}(a.cookieName);if(o){for(t.classList.add(o),i=0,len=s.length;i<len;i++)s[i].removeAttribute("checked");document.getElementById(o).setAttribute("checked","checked")}t.classList.contains(userPrefix+"-"+e.DefaultImageReplacementCheckbox.value)&&l(),t.classList.contains(userPrefix+"-"+e.ImageReplacementCheckbox.value)&&r()}function n(t){a.mode=t.getAttribute("name"),a.cookieName=t.getAttribute("name");var n=document.getElementById(a.mode).querySelectorAll("input"),s=document.querySelector("body");for(i=0,lenx=n.length;i<lenx;i++){var o=n[i].getAttribute("value");n[i].removeAttribute("checked"),o===userPrefix+"-"+e.DefaultImageReplacementCheckbox.value&&l(),s.classList.remove(o)}var c=t.getAttribute("value");t.setAttribute("checked","checked"),(o=t.getAttribute("value"))===userPrefix+"-"+e.ImageReplacementCheckbox.value&&r(),s.classList.add(c),d(a.cookieName,c,"180")}function r(){for(j=0,len=a.imgTab.length;j<len;j++)if(a.imgTab[j].parentNode){var e=a.imgTab[j].parentNode;a.imgTab[j]=e.replaceChild(a.imgSpan[j],a.imgTab[j])}}function l(){for(j=0,len=a.imgSpan.length;j<len;j++)if(a.imgSpan[j].parentNode){var e=a.imgSpan[j].parentNode;a.imgSpan[j]=e.replaceChild(a.imgTab[j],a.imgSpan[j])}}function s(t){document.body.classList.add(userPrefix+"-"+e.BodyActive.classSetting);var i=document.createElement("div");i.classList.add(userPrefix+"-"+e.Overlay.classSetting),document.body.appendChild(i),a.openObj=document.getElementById(userPrefix),a.openObj.style.display="block",document.getElementById(userPrefix+"-"+e.CloseButton.id).focus(),document.addEventListener("keydown",function i(n){if(27===n.keyCode){a.openObj.style.display="none",t.focus(),document.removeEventListener("keydown",i,!1),document.body.classList.remove(userPrefix+"-"+e.BodyActive.classSetting);var r=document.querySelector("."+userPrefix+"-"+e.Overlay.classSetting);r&&r.remove()}},!1);var n=document.getElementById(userPrefix+"-"+e.CloseButton.id);n.addEventListener("click",function i(){a.openObj.style.display="none";t.focus();n.removeEventListener("click",i,!1);document.body.classList.remove(userPrefix+"-"+e.BodyActive.classSetting);var r=document.querySelector("."+userPrefix+"-"+e.Overlay.classSetting);r&&r.remove()},!1),document.addEventListener("focus",o,!0)}function o(e){a.openObj&&!a.openObj.contains(e.target)&&(e.stopPropagation(),a.openObj.focus())}function d(e,a,t){if(t){var i=new Date;i.setTime(i.getTime()+24*t*60*60*1e3);var n="; expires="+i.toGMTString()}else n="";document.cookie=e+"="+a+n+"; path=/"}window.onload=function(){if(document.querySelector("[data-accessconfig-params]")){var n=document.querySelector("[data-accessconfig-params]");if(a.userParams=JSON.parse(n.getAttribute("data-accessconfig-params")),a.userParams.Prefix?userPrefix=a.userParams.Prefix:userPrefix="a42-ac",function(){function t(e){var a=e.tagName,t=document.createElement(a);for(var i in e)"tagName"!=i&&"function"!=typeof e[i]&&t.setAttribute(i,e[i]);return t}var n=(s=document.querySelector("html").getAttribute("lang"),s?(o=s.indexOf("-")>0?s.indexOf("-"):3,s.substring(0,o)):"en"),r=t({tagName:"div",id:userPrefix,class:userPrefix}),l=t({tagName:"div",class:userPrefix+"-"+e.FormFieldsetContent.classSetting});var s,o;if(1==a.userParams.Modal||void 0===a.userParams.Modal){r.setAttribute("role","dialog"),r.setAttribute("aria-labelledby",userPrefix+"-"+e.ModalContainer.titleId),r.setAttribute("tabindex","-1"),a.userParams.ContainerClass?r.classList.add(userPrefix+"-"+a.userParams.ContainerClass):r.classList.add(userPrefix+"-"+e.ModalContainer.classSetting);var d=t({tagName:"h1",id:userPrefix+"-"+e.ModalContainer.titleId});a.userParams.ModalTitle?d.classList.add(userPrefix+a.userParams.ModalTitle):d.classList.add(userPrefix+"-"+e.ModalContainer.titleClass);var c=document.createTextNode(e.ModalContainer.titleLang[n]);d.appendChild(c),r.appendChild(d);var u=t({tagName:"button",type:"button",id:userPrefix+"-"+e.CloseButton.id});a.userParams.ModalCloseButton?u.classList.add(userPrefix+a.userParams.ModalCloseButton):u.classList.add(userPrefix+"-"+e.CloseButton.classSetting);var m=t({tagName:"span",class:e.CloseButton.hiddenTextClass}),f=document.createTextNode(e.CloseButton.lang[n]);m.appendChild(f),u.appendChild(m),r.appendChild(u),r.appendChild(l)}else{var g=document.getElementById(e.Setup.id);g.appendChild(r),r.classList.add(userPrefix+"accessconfig-inline"),r.appendChild(l)}if(0!=a.userParams.Contrast){var p=t({tagName:"fieldset",id:userPrefix+"-"+e.ContrastFieldset.id}),x=document.createElement("legend"),C=document.createTextNode(e.ContrastLegend.lang[n]);x.appendChild(C),p.appendChild(x);var h=t({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+e.DefaultContrastCheckbox.id,value:userPrefix+"-"+e.DefaultContrastCheckbox.value,name:userPrefix+"-"+e.DefaultContrastCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DefaultContrastCheckbox.id}),v=document.createTextNode(e.DefaultContrastCheckbox.lang[n]);if(b.appendChild(v),p.appendChild(h),p.appendChild(b),e.Setting.useExtendContrast){var h=t({tagName:"input",type:"radio",id:userPrefix+"-"+e.HighContrastCheckbox.id,value:userPrefix+"-"+e.HighContrastCheckbox.value,name:userPrefix+"-"+e.HighContrastCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.HighContrastCheckbox.id}),v=document.createTextNode(e.HighContrastCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b)}var h=t({tagName:"input",type:"radio",id:userPrefix+"-"+e.InvertContrastCheckbox.id,value:userPrefix+"-"+e.InvertContrastCheckbox.value,name:userPrefix+"-"+e.InvertContrastCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.InvertContrastCheckbox.id}),v=document.createTextNode(e.InvertContrastCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b),l.appendChild(p)}if(0!=a.userParams.Font){var p=t({tagName:"fieldset",id:userPrefix+"-"+e.DyslexiaFieldset.id}),x=document.createElement("legend"),C=document.createTextNode(e.DyslexiaLegend.lang[n]);x.appendChild(C),p.appendChild(x);var h=t({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+e.DefaultFontCheckbox.id,value:userPrefix+"-"+e.DefaultFontCheckbox.value,name:userPrefix+"-"+e.DefaultFontCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DefaultFontCheckbox.id}),v=document.createTextNode(e.DefaultFontCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b);var h=t({tagName:"input",type:"radio",id:userPrefix+"-"+e.DyslexiaFontCheckbox.id,value:userPrefix+"-"+e.DyslexiaFontCheckbox.value,name:userPrefix+"-"+e.DyslexiaFontCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DyslexiaFontCheckbox.id}),v=document.createTextNode(e.DyslexiaFontCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b),l.appendChild(p)}if(0!=a.userParams.LineSpacing){var p=t({tagName:"fieldset",id:userPrefix+"-"+e.LineSpacingFieldset.id}),x=document.createElement("legend"),C=document.createTextNode(e.LineSpacingLegend.lang[n]);x.appendChild(C),p.appendChild(x);var h=t({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+e.DefaultLineSpacingCheckbox.id,value:userPrefix+"-"+e.DefaultLineSpacingCheckbox.value,name:userPrefix+"-"+e.DefaultLineSpacingCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DefaultLineSpacingCheckbox.id}),v=document.createTextNode(e.DefaultLineSpacingCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b);var h=t({tagName:"input",type:"radio",id:userPrefix+"-"+e.DyslexiaLineSpacingCheckbox.id,value:userPrefix+"-"+e.DyslexiaLineSpacingCheckbox.value,name:userPrefix+"-"+e.DyslexiaLineSpacingCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DyslexiaLineSpacingCheckbox.id}),v=document.createTextNode(e.DyslexiaLineSpacingCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b),l.appendChild(p)}if(0!=a.userParams.Justification){var p=t({tagName:"fieldset",id:userPrefix+"-"+e.JustificationFieldset.id}),x=document.createElement("legend"),C=document.createTextNode(e.JustificationLegend.lang[n]);x.appendChild(C),p.appendChild(x);var h=t({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+e.DefaultJustificationCheckbox.id,value:userPrefix+"-"+e.DefaultJustificationCheckbox.value,name:userPrefix+"-"+e.DefaultJustificationCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DefaultJustificationCheckbox.id}),v=document.createTextNode(e.DefaultJustificationCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b);var h=t({tagName:"input",type:"radio",id:userPrefix+"-"+e.DyslexiaJustificationCheckbox.id,value:userPrefix+"-"+e.DyslexiaJustificationCheckbox.value,name:userPrefix+"-"+e.DyslexiaJustificationCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DyslexiaJustificationCheckbox.id}),v=document.createTextNode(e.DyslexiaJustificationCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b),l.appendChild(p)}if(0!=a.userParams.ImageReplacement){var p=t({tagName:"fieldset",id:userPrefix+"-"+e.ImageReplacementFieldset.id}),x=document.createElement("legend"),C=document.createTextNode(e.ImageReplacementLegend.lang[n]);x.appendChild(C),p.appendChild(x);var h=t({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+e.DefaultImageReplacementCheckbox.id,value:userPrefix+"-"+e.DefaultImageReplacementCheckbox.value,name:userPrefix+"-"+e.DefaultImageReplacementCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.DefaultImageReplacementCheckbox.id}),v=document.createTextNode(e.DefaultImageReplacementCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b);var h=t({tagName:"input",type:"radio",id:userPrefix+"-"+e.ImageReplacementCheckbox.id,value:userPrefix+"-"+e.ImageReplacementCheckbox.value,name:userPrefix+"-"+e.ImageReplacementCheckbox.groupName}),b=t({tagName:"label",for:userPrefix+"-"+e.ImageReplacementCheckbox.id}),v=document.createTextNode(e.ImageReplacementCheckbox.lang[n]);b.appendChild(v),p.appendChild(h),p.appendChild(b),l.appendChild(p)}for(allFieldset=r.querySelectorAll("fieldset"),i=0,len=allFieldset.length;i<len;i++)a.userParams.FormFieldset?allFieldset[i].classList.add(userPrefix+a.userParams.FormFieldset):allFieldset[i].classList.add(userPrefix+"-"+e.FormFieldset.classSetting);for(allLegend=r.querySelectorAll("legend"),i=0,len=allLegend.length;i<len;i++)a.userParams.FormFieldsetLegend?allLegend[i].classList.add(userPrefix+a.userParams.FormFieldsetLegend):allLegend[i].classList.add(userPrefix+"-"+e.LegendFieldset.classSetting);for(allRadio=r.querySelectorAll('input[type="radio"]'),i=0,len=allRadio.length;i<len;i++)a.userParams.FormRadio?allRadio[i].classList.add(userPrefix+a.userParams.FormRadio):allRadio[i].classList.add(userPrefix+"-"+e.FormRadio.classSetting);var P=document.querySelector("body"),k=P.firstChild;1!=a.userParams.Modal&&void 0!==a.userParams.Modal||P.insertBefore(r,k)}(),1==a.userParams.Modal||void 0===a.userParams.Modal){var r=document.createElement("button");r.setAttribute("id",userPrefix+"-"+e.ModalButton.id),r.setAttribute("data-accessconfig-button","true");var l=document.querySelector("[data-accessconfig-buttonname]");l=document.createTextNode(l.getAttribute("data-accessconfig-buttonname"));r.appendChild(l),document.getElementById(e.Setup.id).appendChild(r);var o=document.querySelectorAll('[data-accessconfig-button="true"]');for(i=0,len=o.length;i<len;i++)o[i].addEventListener("click",function(){s(this)},!1)}0!=a.userParams.Contrast&&(a.mode=userPrefix+"-"+e.ContrastFieldset.id,a.cookieName="contrast",t()),0!=a.userParams.Font&&(a.mode=userPrefix+"-"+e.DyslexiaFieldset.id,a.cookieName="font",t()),0!=a.userParams.LineSpacing&&(a.mode=userPrefix+"-"+e.LineSpacingFieldset.id,a.cookieName="line-spacing",t()),0!=a.userParams.Justification&&(a.mode=userPrefix+"-"+e.JustificationFieldset.id,a.cookieName="justification",t()),0!=a.userParams.ImageReplacement&&(a.mode=userPrefix+"-"+e.ImageReplacementFieldset.id,a.cookieName="image",function(){a.imgSpan=new Array;var t="."+userPrefix+"-"+e.ImageReplacementCSS.replacementCss;for(a.imgTab=document.querySelectorAll(t),j=0,len=a.imgTab.length;j<len;j++){var i=document.createElement("span"),n=a.imgTab[j].getAttribute("alt"),r=document.createTextNode(n);i.appendChild(r),i.classList.add(userPrefix+"-"+e.ImageReplacementCSS.replacementCss),i.classList.add(userPrefix+"-"+e.ImageReplacementCSS.replacementStyle),a.imgSpan[j]=i}}(),t())}else console.log("AccessConfig warning : HTML missing")}}();[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}); \ No newline at end of file diff --git a/public/opac/js/access_config/js/accessconfig2.min.js b/public/opac/js/access_config/js/accessconfig2.min.js deleted file mode 100644 index 7defb967582f82f45f4ea4114494bbef0f322b74..0000000000000000000000000000000000000000 --- a/public/opac/js/access_config/js/accessconfig2.min.js +++ /dev/null @@ -1 +0,0 @@ -var AccessConfig=function(){var p={Setup:{id:"accessconfig"},Setting:{useExtendContrast:!0},BodyActive:{classSetting:"active"},Overlay:{classSetting:"overlay"},SettingText:{useExtendText:!0},SettingTextTransform:{useExtendTextTransform:!0},ModalButton:{id:"button"},ModalContainer:{classSetting:"modal",titleLang:{en:"Accessibility setting",fr:"Paramètres d’accessibilité"},titleId:"title",titleClass:"title"},CloseButton:{id:"close",classSetting:"close",lang:{en:"close",fr:"fermer"},hiddenTextClass:"sr-only"},InlineContentContainer:{id:"inline-c"},FormFieldsetContent:{classSetting:"content"},FormFieldset:{classSetting:"fieldset"},LegendFieldset:{classSetting:"legend"},FormRadio:{classSetting:"radio"},ContrastFieldset:{id:"contrast"},ContrastLegend:{lang:{en:"Contrast",fr:"Contrastes"}},DefaultContrastCheckbox:{id:"default-contrast",value:"default-contrast",groupName:"contrast",lang:{en:"Default",fr:"Défaut"}},HighContrastCheckbox:{id:"high-contrast",value:"high-contrast",groupName:"contrast",lang:{en:"Reinforce",fr:"Renforcer"}},InvertContrastCheckbox:{id:"inv-contrast",value:"inv-contrast",groupName:"contrast",lang:{en:"Reverse",fr:"Inverser"}},DyslexiaFieldset:{id:"font"},DyslexiaLegend:{lang:{en:"Font (dyslexia)",fr:"Police (dyslexie)"}},DefaultFontCheckbox:{id:"default-font",value:"default-font",groupName:"font",lang:{en:"Default",fr:"Défaut"}},DyslexiaFontCheckbox:{id:"dys-font",value:"dys-font",groupName:"font",lang:{en:"Adapt",fr:"Adapter"}},LineSpacingFieldset:{id:"line-spacing"},LineSpacingLegend:{lang:{en:"Line spacing",fr:"Interlignage"}},DefaultLineSpacingCheckbox:{id:"default-spacing",value:"default-spacing",groupName:"line-spacing",lang:{en:"Default",fr:"Défaut"}},DyslexiaLineSpacingCheckbox:{id:"dys-spacing",value:"dys-spacing",groupName:"line-spacing",lang:{en:"Increase",fr:"Augmenter"}},LetterSpacingFieldset:{id:"letter-spacing"},LetterSpacingLegend:{lang:{en:"Letter spacing",fr:"Interlettrage"}},DefaultLetterSpacingCheckbox:{id:"default-letter-spacing",value:"default-letter-spacing",groupName:"letter-spacing",lang:{en:"Default",fr:"Défaut"}},DyslexiaLetterSpacingCheckbox:{id:"dys-letter-spacing",value:"dys-letter-spacing",groupName:"letter-spacing",lang:{en:"Increase",fr:"Augmenter"}},JustificationFieldset:{id:"justification"},JustificationLegend:{lang:{en:"Justification",fr:"Justification"}},DefaultJustificationCheckbox:{id:"default-justification",value:"default-justification",groupName:"justification",lang:{en:"Default",fr:"Défaut"}},DyslexiaJustificationCheckbox:{id:"cancel-justification",value:"cancel-justification",groupName:"justification",lang:{en:"Remove",fr:"Supprimer"}},TextFieldset:{id:"text"},TextLegend:{lang:{en:"Text size",fr:"Taille du texte"}},DefaultTextCheckbox:{id:"default-text",value:"default-text",groupName:"text",lang:{en:"Default",fr:"Défaut"}},UpTextCheckbox:{id:"up-text",value:"up-text",groupName:"text",lang:{en:"Up",fr:"Agrandir"}},DownTextCheckbox:{id:"down-text",value:"down-text",groupName:"text",lang:{en:"Down",fr:"Rétrécir"}},TextTransformFieldset:{id:"text-transform"},TextTransformLegend:{lang:{en:"Text Transform",fr:"Transformation du texte"}},DefaultTextTransformCheckbox:{id:"default-text-transform",value:"default-text-transform",groupName:"text-transform",lang:{en:"Default",fr:"Défaut"}},MajTextTransformCheckbox:{id:"maj-text-transform",value:"maj-text-transform",groupName:"text-transform",lang:{en:"Maj",fr:"Majuscule"}},MinTextTransformCheckbox:{id:"min-text-transform",value:"min-text-transform",groupName:"text-transform",lang:{en:"Min",fr:"Minuscule"}}},m={mode:null,cookieName:null,openObj:null,imgTab:null,imgSpan:null};function n(){var e=document.querySelector("body"),t=document.getElementById(m.mode).querySelectorAll("input");for(i=0,len=t.length;i<len;i++)t[i].addEventListener("click",function(){!function(e){m.mode=e.getAttribute("name"),m.cookieName=e.getAttribute("name");var t=document.getElementById(m.mode).querySelectorAll("input"),a=document.querySelector("body");for(i=0,lenx=t.length;i<lenx;i++){var n=t[i].getAttribute("value");t[i].removeAttribute("checked"),a.classList.remove(n)}var r=e.getAttribute("value");e.setAttribute("checked","checked"),n=e.getAttribute("value"),a.classList.add(r),o(m.cookieName,r,"180")}(this)},!1);var a=function(e){for(var t=userPrefix+"-"+e+"=",a=document.cookie.split(";"),i=0;i<a.length;i++){for(var n=a[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t))return n.substring(t.length,n.length)}return null}(m.cookieName);if(a){for(e.classList.add(a),i=0,len=t.length;i<len;i++)t[i].removeAttribute("checked");document.getElementById(a).setAttribute("checked","checked")}}function r(e){m.openObj&&!m.openObj.contains(e.target)&&(e.stopPropagation(),m.openObj.focus())}function o(e,t,a){var i;i=a?((i=new Date).setTime(i.getTime()+24*a*60*60*1e3),"; expires="+i.toGMTString()):"",document.cookie=e+"="+t+i+"; path=/"}window.onload=function(){if(document.querySelector("[data-accessconfig-params]")){var e=document.querySelector("[data-accessconfig-params]");if(m.userParams=JSON.parse(e.getAttribute("data-accessconfig-params")),userPrefix=m.userParams.Prefix||"a42-ac",function(){function e(e){var t,a=e.tagName,i=document.createElement(a);for(t in e)"tagName"!=t&&"function"!=typeof e[t]&&i.setAttribute(t,e[t]);return i}var t,a,n,r,o,d,l,s,u=function(){var e,t=document.querySelector("html").getAttribute("lang");return t?(e=0<t.indexOf("-")?t.indexOf("-"):3,t.substring(0,e)):"en"}(),c=e({tagName:"div",id:userPrefix,class:userPrefix}),f=e({tagName:"div",class:userPrefix+"-"+p.FormFieldsetContent.classSetting});for(1==m.userParams.Modal||void 0===m.userParams.Modal?(c.setAttribute("role","dialog"),c.setAttribute("aria-labelledby",userPrefix+"-"+p.ModalContainer.titleId),c.setAttribute("tabindex","-1"),m.userParams.ContainerClass?c.classList.add(userPrefix+"-"+m.userParams.ContainerClass):c.classList.add(userPrefix+"-"+p.ModalContainer.classSetting),n=e({tagName:"h1",id:userPrefix+"-"+p.ModalContainer.titleId}),m.userParams.ModalTitle?n.classList.add(userPrefix+m.userParams.ModalTitle):n.classList.add(userPrefix+"-"+p.ModalContainer.titleClass),a=document.createTextNode(p.ModalContainer.titleLang[u]),n.appendChild(a),c.appendChild(n),t=e({tagName:"button",type:"button",id:userPrefix+"-"+p.CloseButton.id}),m.userParams.ModalCloseButton?t.classList.add(userPrefix+m.userParams.ModalCloseButton):t.classList.add(userPrefix+"-"+p.CloseButton.classSetting),a=e({tagName:"span",class:p.CloseButton.hiddenTextClass}),n=document.createTextNode(p.CloseButton.lang[u]),a.appendChild(n),t.appendChild(a),c.appendChild(t)):(document.getElementById(p.Setup.id).appendChild(c),c.classList.add(userPrefix+"accessconfig-inline")),c.appendChild(f),0!=m.userParams.Contrast&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.ContrastFieldset.id}),s=document.createElement("legend"),r=document.createTextNode(p.ContrastLegend.lang[u]),s.appendChild(r),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultContrastCheckbox.id,value:userPrefix+"-"+p.DefaultContrastCheckbox.value,name:userPrefix+"-"+p.DefaultContrastCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultContrastCheckbox.id}),o=document.createTextNode(p.DefaultContrastCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),p.Setting.useExtendContrast&&(d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.HighContrastCheckbox.id,value:userPrefix+"-"+p.HighContrastCheckbox.value,name:userPrefix+"-"+p.HighContrastCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.HighContrastCheckbox.id}),o=document.createTextNode(p.HighContrastCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l)),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.InvertContrastCheckbox.id,value:userPrefix+"-"+p.InvertContrastCheckbox.value,name:userPrefix+"-"+p.InvertContrastCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.InvertContrastCheckbox.id}),o=document.createTextNode(p.InvertContrastCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),f.appendChild(x)),0!=m.userParams.Font&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.DyslexiaFieldset.id}),s=document.createElement("legend"),r=document.createTextNode(p.DyslexiaLegend.lang[u]),s.appendChild(r),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultFontCheckbox.id,value:userPrefix+"-"+p.DefaultFontCheckbox.value,name:userPrefix+"-"+p.DefaultFontCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultFontCheckbox.id}),o=document.createTextNode(p.DefaultFontCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.DyslexiaFontCheckbox.id,value:userPrefix+"-"+p.DyslexiaFontCheckbox.value,name:userPrefix+"-"+p.DyslexiaFontCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DyslexiaFontCheckbox.id}),o=document.createTextNode(p.DyslexiaFontCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),f.appendChild(x)),0!=m.userParams.LineSpacing&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.LineSpacingFieldset.id}),s=document.createElement("legend"),r=document.createTextNode(p.LineSpacingLegend.lang[u]),s.appendChild(r),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultLineSpacingCheckbox.id,value:userPrefix+"-"+p.DefaultLineSpacingCheckbox.value,name:userPrefix+"-"+p.DefaultLineSpacingCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultLineSpacingCheckbox.id}),o=document.createTextNode(p.DefaultLineSpacingCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.DyslexiaLineSpacingCheckbox.id,value:userPrefix+"-"+p.DyslexiaLineSpacingCheckbox.value,name:userPrefix+"-"+p.DyslexiaLineSpacingCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DyslexiaLineSpacingCheckbox.id}),o=document.createTextNode(p.DyslexiaLineSpacingCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),f.appendChild(x)),0!=m.userParams.LetterSpacing&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.LetterSpacingFieldset.id}),s=document.createElement("legend"),r=document.createTextNode(p.LetterSpacingLegend.lang[u]),s.appendChild(r),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultLetterSpacingCheckbox.id,value:userPrefix+"-"+p.DefaultLetterSpacingCheckbox.value,name:userPrefix+"-"+p.DefaultLetterSpacingCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultLetterSpacingCheckbox.id}),o=document.createTextNode(p.DefaultLetterSpacingCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.DyslexiaLetterSpacingCheckbox.id,value:userPrefix+"-"+p.DyslexiaLetterSpacingCheckbox.value,name:userPrefix+"-"+p.DyslexiaLetterSpacingCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DyslexiaLetterSpacingCheckbox.id}),o=document.createTextNode(p.DyslexiaLetterSpacingCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),f.appendChild(x)),0!=m.userParams.Justification&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.JustificationFieldset.id}),s=document.createElement("legend"),r=document.createTextNode(p.JustificationLegend.lang[u]),s.appendChild(r),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultJustificationCheckbox.id,value:userPrefix+"-"+p.DefaultJustificationCheckbox.value,name:userPrefix+"-"+p.DefaultJustificationCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultJustificationCheckbox.id}),o=document.createTextNode(p.DefaultJustificationCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.DyslexiaJustificationCheckbox.id,value:userPrefix+"-"+p.DyslexiaJustificationCheckbox.value,name:userPrefix+"-"+p.DyslexiaJustificationCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DyslexiaJustificationCheckbox.id}),o=document.createTextNode(p.DyslexiaJustificationCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),f.appendChild(x)),0!=m.userParams.Text&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.TextFieldset.id}),s=document.createElement("legend"),r=document.createTextNode(p.TextLegend.lang[u]),s.appendChild(r),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultTextCheckbox.id,value:userPrefix+"-"+p.DefaultTextCheckbox.value,name:userPrefix+"-"+p.DefaultTextCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultTextCheckbox.id}),o=document.createTextNode(p.DefaultTextCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),p.SettingText.useExtendText&&(d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.UpTextCheckbox.id,value:userPrefix+"-"+p.UpTextCheckbox.value,name:userPrefix+"-"+p.UpTextCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.UpTextCheckbox.id}),o=document.createTextNode(p.UpTextCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l)),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.DownTextCheckbox.id,value:userPrefix+"-"+p.DownTextCheckbox.value,name:userPrefix+"-"+p.DownTextCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DownTextCheckbox.id}),o=document.createTextNode(p.DownTextCheckbox.lang[u]),l.appendChild(o),x.appendChild(d),x.appendChild(l),f.appendChild(x)),0!=m.userParams.TextTransform&&(x=e({tagName:"fieldset",id:userPrefix+"-"+p.TextTransformFieldset.id}),s=document.createElement("legend"),o=document.createTextNode(p.TextTransformLegend.lang[u]),s.appendChild(o),x.appendChild(s),d=e({tagName:"input",type:"radio",checked:"checked",id:userPrefix+"-"+p.DefaultTextTransformCheckbox.id,value:userPrefix+"-"+p.DefaultTextTransformCheckbox.value,name:userPrefix+"-"+p.DefaultTextTransformCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.DefaultTextTransformCheckbox.id}),s=document.createTextNode(p.DefaultTextTransformCheckbox.lang[u]),l.appendChild(s),x.appendChild(d),x.appendChild(l),p.SettingTextTransform.useExtendTextTransform&&(d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.MajTextTransformCheckbox.id,value:userPrefix+"-"+p.MajTextTransformCheckbox.value,name:userPrefix+"-"+p.MajTextTransformCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.MajTextTransformCheckbox.id}),s=document.createTextNode(p.MajTextTransformCheckbox.lang[u]),l.appendChild(s),x.appendChild(d),x.appendChild(l)),d=e({tagName:"input",type:"radio",id:userPrefix+"-"+p.MinTextTransformCheckbox.id,value:userPrefix+"-"+p.MinTextTransformCheckbox.value,name:userPrefix+"-"+p.MinTextTransformCheckbox.groupName}),l=e({tagName:"label",for:userPrefix+"-"+p.MinTextTransformCheckbox.id}),s=document.createTextNode(p.MinTextTransformCheckbox.lang[u]),l.appendChild(s),x.appendChild(d),x.appendChild(l),f.appendChild(x)),allFieldset=c.querySelectorAll("fieldset"),i=0,len=allFieldset.length;i<len;i++)m.userParams.FormFieldset?allFieldset[i].classList.add(userPrefix+m.userParams.FormFieldset):allFieldset[i].classList.add(userPrefix+"-"+p.FormFieldset.classSetting);for(allLegend=c.querySelectorAll("legend"),i=0,len=allLegend.length;i<len;i++)m.userParams.FormFieldsetLegend?allLegend[i].classList.add(userPrefix+m.userParams.FormFieldsetLegend):allLegend[i].classList.add(userPrefix+"-"+p.LegendFieldset.classSetting);for(allRadio=c.querySelectorAll('input[type="radio"]'),i=0,len=allRadio.length;i<len;i++)m.userParams.FormRadio?allRadio[i].classList.add(userPrefix+m.userParams.FormRadio):allRadio[i].classList.add(userPrefix+"-"+p.FormRadio.classSetting);var x=(f=document.querySelector("body")).firstChild;1!=m.userParams.Modal&&void 0!==m.userParams.Modal||f.insertBefore(c,x)}(),1==m.userParams.Modal||void 0===m.userParams.Modal){var t=document.createElement("button");t.setAttribute("id",userPrefix+"-"+p.ModalButton.id),t.setAttribute("data-accessconfig-button","true");e=document.querySelector("[data-accessconfig-buttonname]"),e=document.createTextNode(e.getAttribute("data-accessconfig-buttonname"));t.appendChild(e),document.getElementById(p.Setup.id).appendChild(t);var a=document.querySelectorAll('[data-accessconfig-button="true"]');for(i=0,len=a.length;i<len;i++)a[i].addEventListener("click",function(){!function(a){document.body.classList.add(userPrefix+"-"+p.BodyActive.classSetting);var e=document.createElement("div");e.classList.add(userPrefix+"-"+p.Overlay.classSetting),document.body.appendChild(e),m.openObj=document.getElementById(userPrefix),m.openObj.style.display="block",document.getElementById(userPrefix+"-"+p.CloseButton.id).focus(),document.addEventListener("keydown",function e(t){27===t.keyCode&&(m.openObj.style.display="none",a.focus(),document.removeEventListener("keydown",e,!1),document.body.classList.remove(userPrefix+"-"+p.BodyActive.classSetting),(t=document.querySelector("."+userPrefix+"-"+p.Overlay.classSetting))&&t.remove())},!1);var i=document.getElementById(userPrefix+"-"+p.CloseButton.id);i.addEventListener("click",function e(){m.openObj.style.display="none",a.focus(),i.removeEventListener("click",e,!1),document.body.classList.remove(userPrefix+"-"+p.BodyActive.classSetting);var t=document.querySelector("."+userPrefix+"-"+p.Overlay.classSetting);t&&t.remove()},!1),document.addEventListener("focus",r,!0)}(this)},!1)}0!=m.userParams.Contrast&&(m.mode=userPrefix+"-"+p.ContrastFieldset.id,m.cookieName="contrast",n()),0!=m.userParams.Font&&(m.mode=userPrefix+"-"+p.DyslexiaFieldset.id,m.cookieName="font",n()),0!=m.userParams.LineSpacing&&(m.mode=userPrefix+"-"+p.LineSpacingFieldset.id,m.cookieName="line-spacing",n()),0!=m.userParams.LetterSpacing&&(m.mode=userPrefix+"-"+p.LetterSpacingFieldset.id,m.cookieName="letter-spacing",n()),0!=m.userParams.Justification&&(m.mode=userPrefix+"-"+p.JustificationFieldset.id,m.cookieName="justification",n()),0!=m.userParams.Text&&(m.mode=userPrefix+"-"+p.TextFieldset.id,m.cookieName="text",n()),0!=m.userParams.TextTransform&&(m.mode=userPrefix+"-"+p.TextTransformFieldset.id,m.cookieName="text-transform",n())}else console.log("AccessConfig warning : HTML missing")}}();[Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){null!==this.parentNode&&this.parentNode.removeChild(this)}})}); \ No newline at end of file diff --git a/public/opac/js/access_config/js/src/accessconfig.js b/public/opac/js/access_config/js/src/accessconfig.js deleted file mode 100755 index 46e72390a967ff1cb29a23006e4efe0959133f8d..0000000000000000000000000000000000000000 --- a/public/opac/js/access_config/js/src/accessconfig.js +++ /dev/null @@ -1,836 +0,0 @@ -/* -@licstart The following is the entire license notice for the -JavaScript code in this page. - -Copyright (C) 2018 Access42 - -The JavaScript code in this page is free software: you can -redistribute it and/or modify it under the terms of the GNU -General Public License (GNU GPL) as published by the Free Software -Foundation, either version 3 of the License, or (at your option) -any later version. The code is distributed WITHOUT ANY WARRANTY; -without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU GPL for more details. - -As additional permission under GNU GPL version 3 section 7, you -may distribute non-source (e.g., minimized or compacted) forms of -that code without the copy of the GNU GPL normally required by -section 4, provided you include this license notice and a URL -through which recipients can access the Corresponding Source. - - -@licend The above is the entire license notice -for the JavaScript code in this page. -*/ -/*** AccessConfig **/ - -var AccessConfig = (function() { - - 'use strict ' - - /*** Configuration **/ - var config = { - Setup:{ - //id to catch in the html - id:'accessconfig', - }, - - /** - General Setting - useExtendContrast : true for three choices (default, inverted, enforced), false for two choices (default, inverted) - **/ - - Setting: { - useExtendContrast: true - }, - BodyActive: { - classSetting: 'active' - }, - Overlay: { - classSetting: 'overlay' - }, - - /** - Modal button and window container - **/ - - ModalButton: { - id: 'button' - }, - ModalContainer: { - classSetting: 'modal', - titleLang: { - en: 'Accessibility setting', - fr: 'Paramètres d’accessibilité', - }, - titleId: 'title', - titleClass: 'title', - }, - CloseButton: { - id: 'close', - classSetting: 'close', - lang: { - en: 'close', - fr: 'fermer' - }, - hiddenTextClass: 'sr-only' - }, - - /** - Inline content container - **/ - - InlineContentContainer: { - id: 'inline-c' - }, - - /** - Parameters checkboxes - lang is based on html lang declaration, first entry is the default when html lang is unknow - **/ - - FormFieldsetContent: { - classSetting: 'content' - }, - FormFieldset: { - classSetting: 'fieldset' - }, - LegendFieldset: { - classSetting: 'legend' - }, - FormRadio:{ - classSetting: 'radio' - }, - - /** Contrast - value : className of the dedicated className style - Important ! : value and id must be identical - **/ - - ContrastFieldset: { - //caution : don't change - id: 'contrast' - }, - ContrastLegend: { - lang: { - en: 'Contrast', - fr: 'Contrastes' - } - }, - DefaultContrastCheckbox: { - id: 'default-contrast', - value: 'default-contrast', - //caution : don't change - groupName: 'contrast', - //label - lang: { - en: 'Default', - fr: 'Défaut' - } - }, - HighContrastCheckbox:{ - id: 'high-contrast', - value: 'high-contrast', - //caution : don't change - groupName: 'contrast', - //label - lang: { - en: 'Reinforce', - fr: 'Renforcer' - } - }, - InvertContrastCheckbox:{ - id: 'inv-contrast', - value: 'inv-contrast', - //caution : don't change - groupName: 'contrast', - //label - lang: { - en: 'Reverse', - fr: 'Inverser' - } - }, - - /** - Dyslexia font - **/ - - DyslexiaFieldset: { - //caution : don't change - id: 'font' - }, - DyslexiaLegend: { - //label - lang: { - en: 'Font (dyslexia)', - fr: 'Police (dyslexie)' - } - }, - DefaultFontCheckbox:{ - id: 'default-font', - value: 'default-font', - //caution : don't change - groupName: 'font', - //label - lang: { - en: 'Default', - fr: 'Défaut' - } - }, - DyslexiaFontCheckbox:{ - id: 'dys-font', - value: 'dys-font', - //caution : don't change - groupName: 'font', - //label - lang: { - en: 'Adapt', - fr: 'Adapter' - } - }, - - /** - Line spacing - **/ - - LineSpacingFieldset: { - //caution : don't change - id: 'line-spacing' - }, - LineSpacingLegend: { - //label - lang: { - en: 'Line spacing', - fr: 'Interlignage' - } - }, - DefaultLineSpacingCheckbox:{ - id: 'default-spacing', - value: 'default-spacing', - //caution : don't change - groupName: 'line-spacing', - //label - lang: { - en: 'Default', - fr: 'Défaut' - } - }, - DyslexiaLineSpacingCheckbox:{ - id: 'dys-spacing', - value: 'dys-spacing', - //caution : don't change - groupName: 'line-spacing', - //label - lang: { - en: 'Increase', - fr: 'Augmenter' - } - }, - - /** - Justification - **/ - - JustificationFieldset: { - //caution : don't change - id: 'justification' - }, - JustificationLegend: { - //label - lang: { - en: 'Justification', - fr: 'Justification' - } - }, - DefaultJustificationCheckbox:{ - id: 'default-justification', - value: 'default-justification', - //caution : don't change - groupName: 'justification', - //label - lang: { - en: 'Default', - fr: 'Défaut' - } - }, - DyslexiaJustificationCheckbox:{ - id: 'cancel-justification', - value: 'cancel-justification', - //caution : don't change - groupName: 'justification', - //label - lang: { - en: 'Remove', - fr: 'Supprimer' - } - }, - - /** - Image replacement - **/ - - ImageReplacementFieldset: { - //caution : don't change - id: 'image' - }, - ImageReplacementCSS: { - //Css class to use on each image to replace - replacementCss: 'replace-img', - //Css class to style the replacement text - replacementStyle: 'replace-style' - }, - ImageReplacementLegend: { - //label - lang: { - en: 'Images', - fr: 'Images' - } - }, - DefaultImageReplacementCheckbox:{ - id: 'default-img', - value: 'default-img', - //caution : don't change - groupName: 'image', - //label - lang: { - en: 'Default', - fr: 'Défaut' - } - }, - ImageReplacementCheckbox:{ - id: 'text-img', - value: 'text-img', - //caution : don't change - groupName: 'image', - //label - lang: { - en: 'Replace with text', - fr: 'Remplacer par du texte' - } - }, - } - //global - var global = { - mode: null, - cookieName: null, - openObj: null, - imgTab : null, - imgSpan: null - } - - /** Onload */ - window.onload = function(){ - - if(!document.querySelector( '[data-accessconfig-params]' )){ - console.log('AccessConfig warning : HTML missing') - }else{ - /** Get parameters define in HTML code by user via data-accessconfig-params attribut (JSON format) **/ - var openButton = document.querySelector( '[data-accessconfig-params]' ); - global.userParams = JSON.parse(openButton.getAttribute( 'data-accessconfig-params' )); - global.userParams.Prefix ? (userPrefix = global.userParams.Prefix) : (userPrefix = 'a42-ac'); - - /** Set the setting form **/ - settingForm(); - - /** Modal option**/ - if( global.userParams.Modal == true || global.userParams.Modal === undefined) { - /** If user set data-accessconfig-param.Modal to true, then create a button to launch the modal **/ - var modalButton = document.createElement( 'button' ); - modalButton.setAttribute( 'id', userPrefix+'-'+config.ModalButton.id ); - modalButton.setAttribute( 'data-accessconfig-button','true' ); - - var modalButtonText = document.querySelector( '[data-accessconfig-buttonname]' ); - var modalButtonText = document.createTextNode(modalButtonText.getAttribute( 'data-accessconfig-buttonname' )); - modalButton.appendChild(modalButtonText); - - var setup = document.getElementById(config.Setup.id); - setup.appendChild(modalButton); - - /** Detect other button that can launch the modal by search to data-accessconfig-button="true" **/ - var otherOpenButton = document.querySelectorAll( '[data-accessconfig-button="true"]' ); - for (i = 0, len = otherOpenButton.length; i < len; i++ ){ - otherOpenButton[i].addEventListener( 'click', function(){ - dialog( this ); - }, false); - } - } - - // Contrast features - if(global.userParams.Contrast != false){ - global.mode = userPrefix+'-'+config.ContrastFieldset.id; - global.cookieName = 'contrast'; - setEvent(); - } - // Font feature - if(global.userParams.Font != false){ - global.mode = userPrefix+'-'+config.DyslexiaFieldset.id; - global.cookieName = 'font'; - setEvent(); - } - // Line spacing feature - if(global.userParams.LineSpacing != false){ - global.mode = userPrefix+'-'+config.LineSpacingFieldset.id; - global.cookieName = 'line-spacing'; - setEvent(); - } - // Justification feature - if(global.userParams.Justification != false){ - global.mode = userPrefix+'-'+config.JustificationFieldset.id; - global.cookieName = 'justification'; - setEvent(); - } - // Image replacement feature - if(global.userParams.ImageReplacement != false){ - global.mode = userPrefix+'-'+config.ImageReplacementFieldset.id; - global.cookieName = 'image'; - setImgtab(); - setEvent(); - } - - } - } - - /** Dependencies **/ - /* Create modal or inline setting form : data-accessconfig-params = "Modal" */ - function settingForm(){ - - //Constructor - function $create (o) { - var tn = o.tagName; - var x = document.createElement(tn); - for (var i in o) if (i!='tagName'&&typeof(o[i])!='function') x.setAttribute(i, o[i]); - return x; - } - - var langRef = setdefaultLang(); - var div = $create({tagName:'div', id:userPrefix, class:userPrefix}); - - var fieldsetContent = $create( {tagName:'div', class:userPrefix+'-'+config.FormFieldsetContent.classSetting}); - - // set modale - if( global.userParams.Modal == true || global.userParams.Modal === undefined) { - //modale - div.setAttribute( 'role', 'dialog' ); - div.setAttribute( 'aria-labelledby', userPrefix+'-'+config.ModalContainer.titleId ); - div.setAttribute( 'tabindex', '-1' ); - global.userParams.ContainerClass ? div.classList.add( userPrefix+'-'+global.userParams.ContainerClass ) : - div.classList.add( userPrefix+'-'+config.ModalContainer.classSetting ); - //title - var titleWindow = $create({tagName:'h1', id:userPrefix+'-'+config.ModalContainer.titleId}); - global.userParams.ModalTitle ? titleWindow.classList.add( userPrefix+global.userParams.ModalTitle ) : - titleWindow.classList.add( userPrefix+'-'+config.ModalContainer.titleClass ); - var titleTxt = document.createTextNode( config.ModalContainer.titleLang[ langRef ]); - titleWindow.appendChild( titleTxt ); - div.appendChild( titleWindow ); - //Close button - var CClose = $create({tagName:'button', type:'button',id:userPrefix+'-'+config.CloseButton.id}); - global.userParams.ModalCloseButton ? CClose.classList.add( userPrefix+global.userParams.ModalCloseButton ) : - CClose.classList.add( userPrefix+'-'+config.CloseButton.classSetting ); - var SpanHidden = $create({tagName:'span', class:config.CloseButton.hiddenTextClass}); - var CloseTxt = document.createTextNode( config.CloseButton.lang[ langRef ]); - SpanHidden.appendChild( CloseTxt ); - CClose.appendChild( SpanHidden ); - div.appendChild( CClose ); - div.appendChild(fieldsetContent); - } - else { - //Inline form - var setupdiv = document.getElementById( config.Setup.id ); - setupdiv.appendChild(div); - div.classList.add( userPrefix+'accessconfig-inline'); - div.appendChild(fieldsetContent); - } - - /** - Contrast features - **/ - - if(global.userParams.Contrast != false){ - - var fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.ContrastFieldset.id}); - var legend = document.createElement( 'legend' ); - var legendText = document.createTextNode( config.ContrastLegend.lang[ langRef ] ); - legend.appendChild( legendText ); - fieldset.appendChild( legend ); - - /**Default option**/ - var CInput = $create({tagName:'input', type:'radio', checked:'checked', id:userPrefix+'-'+config.DefaultContrastCheckbox.id, value:userPrefix+'-'+config.DefaultContrastCheckbox.value, name:userPrefix+'-'+config.DefaultContrastCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DefaultContrastCheckbox.id}); - var defaultCText = document.createTextNode ( config.DefaultContrastCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - - /**Alterntative option 1 : higher contrast**/ - if( config.Setting.useExtendContrast ) { - var CInput = $create({tagName:'input', type:'radio', id:userPrefix+'-'+config.HighContrastCheckbox.id , value:userPrefix+'-'+config.HighContrastCheckbox.value, name:userPrefix+'-'+config.HighContrastCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.HighContrastCheckbox.id}); - var defaultCText = document.createTextNode ( config.HighContrastCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - } - - /**Alterntative option 2 : inverted contrast**/ - var CInput = $create({tagName:'input', type:'radio', id:userPrefix+'-'+config.InvertContrastCheckbox.id, value:userPrefix+'-'+config.InvertContrastCheckbox.value, name:userPrefix+'-'+config.InvertContrastCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.InvertContrastCheckbox.id}); - var defaultCText = document.createTextNode ( config.InvertContrastCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - fieldsetContent.appendChild( fieldset ); - } - - /** - Font feature - **/ - - if(global.userParams.Font != false){ - var fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.DyslexiaFieldset.id}); - var legend = document.createElement( 'legend' ); - var legendText = document.createTextNode( config.DyslexiaLegend.lang[ langRef ] ); - legend.appendChild( legendText ); - fieldset.appendChild( legend ); - - /**Default option**/ - var CInput = $create({tagName:'input', type:'radio', checked:'checked', id:userPrefix+'-'+config.DefaultFontCheckbox.id, value:userPrefix+'-'+config.DefaultFontCheckbox.value, name:userPrefix+'-'+config.DefaultFontCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DefaultFontCheckbox.id}); - var defaultCText = document.createTextNode ( config.DefaultFontCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - - /**Alternative option : alternative font OpenDyslexic**/ - var CInput = $create({tagName:'input', type:'radio', id:userPrefix+'-'+config.DyslexiaFontCheckbox.id, value:userPrefix+'-'+config.DyslexiaFontCheckbox.value, name:userPrefix+'-'+config.DyslexiaFontCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DyslexiaFontCheckbox.id}); - var defaultCText = document.createTextNode ( config.DyslexiaFontCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - fieldsetContent.appendChild( fieldset ); - } - - /** - Line spacing feature - **/ - - if(global.userParams.LineSpacing != false){ - var fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.LineSpacingFieldset.id}); - var legend = document.createElement( 'legend' ); - var legendText = document.createTextNode( config.LineSpacingLegend.lang[ langRef ] ); - legend.appendChild( legendText ); - fieldset.appendChild( legend ); - - /**Default option**/ - var CInput = $create({tagName:'input', type:'radio',checked:'checked', id:userPrefix+'-'+config.DefaultLineSpacingCheckbox.id, value:userPrefix+'-'+config.DefaultLineSpacingCheckbox.value, name:userPrefix+'-'+config.DefaultLineSpacingCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DefaultLineSpacingCheckbox.id}); - var defaultCText = document.createTextNode ( config.DefaultLineSpacingCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - - /**Alternative option : line spacing increase**/ - var CInput = $create({tagName:'input', type:'radio',id:userPrefix+'-'+config.DyslexiaLineSpacingCheckbox.id, value:userPrefix+'-'+config.DyslexiaLineSpacingCheckbox.value, name:userPrefix+'-'+config.DyslexiaLineSpacingCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DyslexiaLineSpacingCheckbox.id}); - var defaultCText = document.createTextNode ( config.DyslexiaLineSpacingCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - fieldsetContent.appendChild( fieldset ); - } - - /** - Justification feature - **/ - - if(global.userParams.Justification != false){ - var fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.JustificationFieldset.id}); - var legend = document.createElement( 'legend' ); - var legendText = document.createTextNode( config.JustificationLegend.lang[ langRef ] ); - legend.appendChild( legendText ); - fieldset.appendChild( legend ); - - /**Default option**/ - var CInput = $create({tagName:'input', type:'radio',checked:'checked', id:userPrefix+'-'+config.DefaultJustificationCheckbox.id, value:userPrefix+'-'+config.DefaultJustificationCheckbox.value, name:userPrefix+'-'+config.DefaultJustificationCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DefaultJustificationCheckbox.id}); - var defaultCText = document.createTextNode ( config.DefaultJustificationCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - - /**Alternative option : kill justification**/ - var CInput = $create({tagName:'input', type:'radio',id:userPrefix+'-'+config.DyslexiaJustificationCheckbox.id, value:userPrefix+'-'+config.DyslexiaJustificationCheckbox.value, name:userPrefix+'-'+config.DyslexiaJustificationCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DyslexiaJustificationCheckbox.id}); - var defaultCText = document.createTextNode ( config.DyslexiaJustificationCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - fieldsetContent.appendChild( fieldset ); - } - - /** - Image replacement feature - **/ - - if(global.userParams.ImageReplacement != false){ - var fieldset = $create({tagName:'fieldset', id:userPrefix+'-'+config.ImageReplacementFieldset.id}); - var legend = document.createElement( 'legend' ); - var legendText = document.createTextNode( config.ImageReplacementLegend.lang[ langRef ] ); - legend.appendChild( legendText ); - fieldset.appendChild( legend ); - - /**Default option**/ - var CInput = $create({tagName:'input', type:'radio',checked:'checked', id:userPrefix+'-'+config.DefaultImageReplacementCheckbox.id, value:userPrefix+'-'+config.DefaultImageReplacementCheckbox.value, name:userPrefix+'-'+config.DefaultImageReplacementCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.DefaultImageReplacementCheckbox.id}); - var defaultCText = document.createTextNode ( config.DefaultImageReplacementCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - - /**Alternative option : Image replacement**/ - var CInput = $create({tagName:'input', type:'radio', id:userPrefix+'-'+config.ImageReplacementCheckbox.id, value:userPrefix+'-'+config.ImageReplacementCheckbox.value, name:userPrefix+'-'+config.ImageReplacementCheckbox.groupName}); - var CLabel = $create({tagName:'label', for:userPrefix+'-'+config.ImageReplacementCheckbox.id}); - var defaultCText = document.createTextNode ( config.ImageReplacementCheckbox.lang[ langRef ] ); - CLabel.appendChild( defaultCText ); - fieldset.appendChild( CInput ); - fieldset.appendChild( CLabel ); - fieldsetContent.appendChild( fieldset ); - } - - /**Set generic class attributes on fieldset, legend and radio**/ - - allFieldset = div.querySelectorAll( 'fieldset' ); - for (i = 0, len = allFieldset.length; i < len; i++ ){ - global.userParams.FormFieldset ? allFieldset[i].classList.add( userPrefix+global.userParams.FormFieldset ) : - allFieldset[i].classList.add( userPrefix+'-'+config.FormFieldset.classSetting ); - } - - allLegend = div.querySelectorAll( 'legend' ); - for (i = 0, len = allLegend.length; i < len; i++ ){ - global.userParams.FormFieldsetLegend ? allLegend[i].classList.add( userPrefix+global.userParams.FormFieldsetLegend ) : - allLegend[i].classList.add( userPrefix+'-'+config.LegendFieldset.classSetting ); - } - - allRadio = div.querySelectorAll( 'input[type="radio"]' ); - for (i = 0, len = allRadio.length; i < len; i++ ){ - global.userParams.FormRadio ? allRadio[i].classList.add( userPrefix+global.userParams.FormRadio ) : - allRadio[i].classList.add( userPrefix+'-'+config.FormRadio.classSetting ); - } - - /** Set the modal **/ - var modalAttach = document.querySelector( 'body'); - var modalAttachFirstChild = modalAttach.firstChild; - /** attach modal as the first child of body **/ - if( global.userParams.Modal == true || global.userParams.Modal === undefined) modalAttach.insertBefore( div, modalAttachFirstChild); - } - - /** Get default language (based on lang attribute) **/ - function setdefaultLang(){ - var lang = document.querySelector( 'html' ).getAttribute( 'lang' ); - if( lang ){ - var ndx; - ( lang.indexOf( '-' ) > 0 ) ? ndx = lang.indexOf( '-' ) : ndx = 3; - return lang.substring( 0, ndx ); - } - else { - return 'en'; - } - } - - /** Setting managers **/ - function setEvent(){ - var body = document.querySelector( 'body' ); - var fieldset = document.getElementById( global.mode ); - var checkBoxList = fieldset.querySelectorAll( 'input' ); - for (i = 0, len = checkBoxList.length; i < len; i++ ){ - checkBoxList[i].addEventListener( 'click', function(){ - setAdaptive( this ); - }, false); - } - var target = readCookie( global.cookieName ); - if( target ){ - - body.classList.add( target ); - for (i = 0, len = checkBoxList.length; i < len; i++ ){ - checkBoxList[i].removeAttribute( 'checked' ); - } - document.getElementById( target ).setAttribute( 'checked', 'checked'); - } - //Setting image replacement - if( body.classList.contains( userPrefix+'-'+config.DefaultImageReplacementCheckbox.value ) ){ - replaceImgSpan(); - } - if( body.classList.contains( userPrefix+'-'+config.ImageReplacementCheckbox.value ) ){ - replaceImg(); - } - } - /**Set adaptive mode**/ - function setAdaptive( obj ){ - global.mode = obj.getAttribute( 'name' ); - global.cookieName = obj.getAttribute( 'name' ); - var fieldset = document.getElementById( global.mode ); - - var checkBoxList = fieldset.querySelectorAll( 'input' ); - var body = document.querySelector( 'body' ); - for (i = 0, lenx = checkBoxList.length; i < lenx; i++ ){ - var value = checkBoxList[i].getAttribute( 'value' ); - checkBoxList[i].removeAttribute('checked'); - if( value === userPrefix+'-'+config.DefaultImageReplacementCheckbox.value){ - replaceImgSpan(); - } - body.classList.remove( value ); - - } - var newClass = obj.getAttribute( 'value' ); - obj.setAttribute( 'checked', 'checked' ); - var value = obj.getAttribute( 'value' ); - if( value === userPrefix+'-'+config.ImageReplacementCheckbox.value){ - replaceImg(); - } - body.classList.add( newClass ); - createCookie(global.cookieName, newClass,'180'); - } - - /** - Image replacement helpers - **/ - - function setImgtab(){ - global.imgSpan = new Array; - var selector = '.'+ userPrefix+'-'+config.ImageReplacementCSS.replacementCss; - global.imgTab = document.querySelectorAll( selector ); - for (j = 0, len = global.imgTab.length; j < len; j++ ){ - var imgPReplacement = document.createElement( 'span' ); - var imgAlt = global.imgTab[j].getAttribute( 'alt' ); - var imgTxtReplacement = document.createTextNode( imgAlt ); - imgPReplacement.appendChild( imgTxtReplacement ); - imgPReplacement.classList.add( userPrefix+'-'+config.ImageReplacementCSS.replacementCss ); - imgPReplacement.classList.add( userPrefix+'-'+config.ImageReplacementCSS.replacementStyle ); - global.imgSpan[j] = imgPReplacement; - } - } - function replaceImg(){ - for (j = 0, len = global.imgTab.length; j < len; j++ ){ - if( global.imgTab[j].parentNode ){ - var parent = global.imgTab[j].parentNode; - global.imgTab[j] = parent.replaceChild( global.imgSpan[j], global.imgTab[j] ); - } - } - } - function replaceImgSpan(){ - for (j = 0, len = global.imgSpan.length; j < len; j++ ){ - if( global.imgSpan[j].parentNode ){ - var parent = global.imgSpan[j].parentNode; - global.imgSpan[j] = parent.replaceChild( global.imgTab[j], global.imgSpan[j] ); - } - } - } - - /** - Modal manager - **/ - - function dialog( returnTo ) { - //on ajoute une classe au body - document.body.classList.add(userPrefix+'-'+config.BodyActive.classSetting); - var overlay = document.createElement( 'div' ); - overlay.classList.add( userPrefix+'-'+config.Overlay.classSetting ); - document.body.appendChild(overlay); - - //open - global.openObj = document.getElementById( userPrefix ); - global.openObj.style.display = 'block'; - document.getElementById( userPrefix+'-'+config.CloseButton.id ).focus(); - //Init events - //escape close - document.addEventListener( 'keydown', escClose, false ); - //button close - var closeButton = document.getElementById( userPrefix+'-'+config.CloseButton.id ); - closeButton.addEventListener( 'click', buttonClose, false ); - //trappingFocus - document.addEventListener( 'focus', trappingFocus, true ); - //close functions - function escClose( event ){ - if( event.keyCode === 27 ){ - global.openObj.style.display = 'none'; - returnTo.focus(); - //reset listener and object trapping focus - document.removeEventListener( 'keydown', escClose , false ); - //on retire la classe du body - document.body.classList.remove(userPrefix+'-'+config.BodyActive.classSetting); - var overlay = document.querySelector( '.'+userPrefix+'-'+config.Overlay.classSetting ); - if(overlay){ - overlay.remove(); - } - //global.openObj = null; - } - } - function buttonClose(){ - global.openObj.style.display = 'none'; - returnTo.focus(); - //reset listener and object trapping focus - closeButton.removeEventListener( 'click', buttonClose, false ); - //on retire la classe du body - document.body.classList.remove(userPrefix+'-'+config.BodyActive.classSetting); - var overlay = document.querySelector( '.'+userPrefix+'-'+config.Overlay.classSetting ); - if(overlay){ - overlay.remove(); - } - //reset object trapping focus - //global.openObj = null - } - } - /* Generic trapping focus function (based on global.openObj setting) */ - function trappingFocus( event ){ - if ( global.openObj && !global.openObj.contains( event.target ) ) { - event.stopPropagation(); - global.openObj.focus(); - } - } - - /** - Cookies - **/ - function createCookie( name, value, days ) { - if ( days ) { - var datetime = new Date(); - datetime.setTime( datetime.getTime() + ( days * 24 * 60 * 60 * 1000 ) ); - var expires = "; expires=" + datetime.toGMTString(); - } - else var expires = ""; - document.cookie = name + "=" + value + expires + "; path=/"; - } - function readCookie( name ) { - var nameEQ = userPrefix+'-'+name + "="; - var ca = document.cookie.split( ';' ); - for(var i = 0; i < ca.length; i++ ) { - var c = ca[i]; - while ( c.charAt(0) == ' ' ) c = c.substring( 1, c.length ); - if ( c.indexOf( nameEQ ) == 0 ) return c.substring( nameEQ.length, c.length ); - } - return null; - } - function eraseCookie( name ) { - createCookie( name , "", -1 ); - } -} )(); - -//Polyfill pour la méthode remove non disponible dans InternetExplorer -//Credit : https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md - -(function (arr) { - arr.forEach(function (item) { - if (item.hasOwnProperty('remove')) { - return; - } - Object.defineProperty(item, 'remove', { - configurable: true, - enumerable: true, - writable: true, - value: function remove() { - if (this.parentNode !== null) - this.parentNode.removeChild(this); - } - }); - }); -})([Element.prototype, CharacterData.prototype, DocumentType.prototype]); \ No newline at end of file