server/dist/accessibility-accessibility.js

3 lines
6.7 KiB
JavaScript
Raw Normal View History

/*! 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 settin
//# sourceMappingURL=accessibility-accessibility.js.map?v=463f394631a54d1e800e