server/dist/accessibility-accessibility.js

3 lines
6.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see accessibility-accessibility.js.LICENSE.txt */
(()=>{"use strict";var e,i={26795:(e,i,s)=>{var r=s(20144),n=s(79753),c=s(16453),a=s(4820);const o={name:"ItemPreview",props:{preview:{type:Object,required:!0},selected:{type:String,default:null}},computed:{checked:{get(){return this.selected===this.preview.id},set(e){this.$emit("select",e?this.preview.id:"")}}}};var l=s(51900);const d=(0,l.Z)(o,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:{preview:!0}},[i("div",{staticClass:"preview-image",style:{backgroundImage:"url("+e.preview.img+")"}}),e._v(" "),i("div",{staticClass:"preview-description"},[i("h3",[e._v(e._s(e.preview.title))]),e._v(" "),i("p",[e._v(e._s(e.preview.text))]),e._v(" "),i("input",{directives:[{name:"model",rawName:"v-model",value:e.checked,expression:"checked"}],staticClass:"checkbox",attrs:{id:"accessibility-"+e.preview.id,type:"checkbox"},domProps:{checked:Array.isArray(e.checked)?e._i(e.checked,null)>-1:e.checked},on:{change:function(t){var i=e.checked,s=t.target,r=!!s.checked;if(Array.isArray(i)){var n=e._i(i,null);s.checked?n<0&&(e.checked=i.concat([null])):n>-1&&(e.checked=i.slice(0,n).concat(i.slice(n+1)))}else e.checked=r}}}),e._v(" "),i("label",{attrs:{for:"accessibility-"+e.preview.id}},[e._v(e._s(e.preview.enableLabel))])])])}),[],!1,null,null,null).exports,h=(0,c.loadState)("accessibility","available-config"),u=(0,c.loadState)("accessibility","user-config"),v={name:"Accessibility",components:{ItemPreview:d},data:()=>({availableConfig:h,userConfig:u}),computed:{themes(){return this.availableConfig.themes},highcontrast(){return this.availableConfig.highcontrast},fonts(){return this.availableConfig.fonts},selected(){return{theme:this.userConfig.theme,highcontrast:this.userConfig.highcontrast,font:this.userConfig.font}},description(){return t("accessibility","Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines}Web Content Accessibility Guidelines{linkend} 2.1 on AA level, with the high contrast theme even on AAA level.").replace("{guidelines}",this.guidelinesLink).replace("{linkend}","</a>")},guidelinesLink:()=>'<a target="_blank" href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noreferrer nofollow">',descriptionDetail(){return t("accessibility","If you find any issues, dont hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!").replace("{issuetracker}",this.issuetrackerLink).replace("{designteam}",this.designteamLink).replace(/\{linkend\}/g,"</a>")},issuetrackerLink:()=>'<a target="_blank" href="https://github.com/nextcloud/server/issues/" rel="noreferrer nofollow">',designteamLink:()=>'<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">'},methods:{selectHighContrast(e){this.selectItem("highcontrast",e),document.body.classList.toggle("theme--highcontrast")},selectTheme(e){const t=this.selected.theme;t&&document.body.classList.remove("theme--".concat(t)),e?(document.body.classList.remove("theme--light"),document.body.classList.add("theme--".concat(e))):document.body.classList.add("theme--light"),this.selectItem("theme",e)},selectFont(e){this.selectItem("font",e)},async selectItem(e,i){try{const t=""===i;await(0,a.default)({url:(0,n.generateOcsUrl)("apps/accessibility/api/v1/config/{type}",{type:e}),method:t?"DELETE":"PUT",data:{value:i}}),this.userConfig[e]=i;const s=document.querySelector("link[rel=stylesheet][href*=accessibility][href*=user-]");if(s)JSON.stringify(Object.values(this.selected))===JSON.stringify([!1,!1])?s.remove():s.href=s.href.split("?")[0]+"?v="+(new Date).getTime();else{const e=document.createElement("link");e.rel="stylesheet",e.href=(0,n.generateUrl)("/apps/accessibility/css/user-style.css")+"?v="+(new Date).getTime(),document.head.appendChild(e)}}catch(e){console.error(e,e.response),OC.Notification.showTemporary(t("accessibility",e.response.data.ocs.meta.message+". Unable to apply the setting."))}}}},p=(0,l.Z)(v,(function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"section",attrs:{id:"accessibility"}},[i("h2",[e._v(e._s(e.t("accessibility","Accessibility")))]),e._v(" "),i("p",{domProps:{innerHTML:e._s(e.description)}}),e._v(" "),i("p",{domProps:{innerHTML:e._s(e.descriptionDetail)}}),e._v(" "),i("div",{staticClass:"preview-list"},[i("ItemPreview",{key:e.highcontrast.id,attrs:{preview:e.highcontrast,selected:e.selected.highcontrast},on:{select:e.selectHighContrast}}),e._v(" "),e._l(e.themes,(function(t){return i("ItemPreview",{key:t.id,attrs:{preview:t,selected:e.selected.theme},on:{select:e.selectTheme}})})),e._v(" "),e._l(e.fonts,(function(t){return i("ItemPreview",{key:t.id,attrs:{preview:t,selected:e.selected.font},on:{select:e.selectFont}})}))],2)])}),[],!1,null,null,null).exports;r.default.prototype.OC=OC,r.default.prototype.t=t,(new(r.default.extend(p))).$mount("#accessibility")}},s={};function r(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={id:e,loaded:!1,exports:{}};return i[e].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.m=i,r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},e=[],r.O=(t,i,s,n)=>{if(!i){var c=1/0;for(d=0;d<e.length;d++){i=e[d][0],s=e[d][1],n=e[d][2];for(var a=!0,o=0;o<i.length;o++)(!1&n||c>=n)&&Object.keys(r.O).every((e=>r.O[e](i[o])))?i.splice(o--,1):(a=!1,n<c&&(c=n));if(a){e.splice(d--,1);var l=s();void 0!==l&&(t=l)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[i,s,n]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.j=189,(()=>{var e={189:0};r.O.j=t=>0===e[t];var t=(t,i)=>{var s,n,c=i[0],a=i[1],o=i[2],l=0;if(c.some((t=>0!==e[t]))){for(s in a)r.o(a,s)&&(r.m[s]=a[s]);if(o)var d=o(r)}for(t&&t(i);l<c.length;l++)n=c[l],r.o(e,n)&&e[n]&&e[n][0](),e[c[l]]=0;return r.O(d)},i=self.webpackChunknextcloud=self.webpackChunknextcloud||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var n=r.O(void 0,[820],(()=>r(26795)));n=r.O(n)})();
//# sourceMappingURL=accessibility-accessibility.js.map?v=463f394631a54d1e800e