diff options
Diffstat (limited to 'dist/accessibility-accessibility.js')
-rw-r--r-- | dist/accessibility-accessibility.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/dist/accessibility-accessibility.js b/dist/accessibility-accessibility.js index 4dc2aafbd8c..7d755b138fb 100644 --- a/dist/accessibility-accessibility.js +++ b/dist/accessibility-accessibility.js @@ -1,3 +1,3 @@ /*! 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, don’t 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,[874],(()=>r(26795)));n=r.O(n)})(); -//# sourceMappingURL=accessibility-accessibility.js.map?v=38950b13a6bb05f9a56d
\ No newline at end of file +!function(){"use strict";var e,n={26795:function(e,n,i){var r=i(20144),s=i(79753),c=i(16453),o=i(4820),a={name:"ItemPreview",props:{preview:{type:Object,required:!0},selected:{type:String,default:null}},computed:{checked:{get:function(){return this.selected===this.preview.id},set:function(e){this.$emit("select",e?this.preview.id:"")}}}},l=i(51900),u=(0,l.Z)(a,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{preview:!0}},[n("div",{staticClass:"preview-image",style:{backgroundImage:"url("+e.preview.img+")"}}),e._v(" "),n("div",{staticClass:"preview-description"},[n("h3",[e._v(e._s(e.preview.title))]),e._v(" "),n("p",[e._v(e._s(e.preview.text))]),e._v(" "),n("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 n=e.checked,i=t.target,r=!!i.checked;if(Array.isArray(n)){var s=e._i(n,null);i.checked?s<0&&(e.checked=n.concat([null])):s>-1&&(e.checked=n.slice(0,s).concat(n.slice(s+1)))}else e.checked=r}}}),e._v(" "),n("label",{attrs:{for:"accessibility-"+e.preview.id}},[e._v(e._s(e.preview.enableLabel))])])])}),[],!1,null,null,null).exports;function d(e,t,n,i,r,s,c){try{var o=e[s](c),a=o.value}catch(e){return void n(e)}o.done?t(a):Promise.resolve(a).then(i,r)}var h=(0,c.loadState)("accessibility","available-config"),f=(0,c.loadState)("accessibility","user-config"),v={name:"Accessibility",components:{ItemPreview:u},data:function(){return{availableConfig:h,userConfig:f}},computed:{themes:function(){return this.availableConfig.themes},highcontrast:function(){return this.availableConfig.highcontrast},fonts:function(){return this.availableConfig.fonts},selected:function(){return{theme:this.userConfig.theme,highcontrast:this.userConfig.highcontrast,font:this.userConfig.font}},description:function(){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:function(){return'<a target="_blank" href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noreferrer nofollow">'},descriptionDetail:function(){return t("accessibility","If you find any issues, don’t 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:function(){return'<a target="_blank" href="https://github.com/nextcloud/server/issues/" rel="noreferrer nofollow">'},designteamLink:function(){return'<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">'}},methods:{selectHighContrast:function(e){this.selectItem("highcontrast",e),document.body.classList.toggle("theme--highcontrast")},selectTheme:function(e){var 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:function(e){this.selectItem("font",e)},selectItem:function(e,n){var i,r=this;return(i=regeneratorRuntime.mark((function i(){var c,a,l;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,c=""===n,i.next=4,(0,o.default)({url:(0,s.generateOcsUrl)("apps/accessibility/api/v1/config/{type}",{type:e}),method:c?"DELETE":"PUT",data:{value:n}});case 4:r.userConfig[e]=n,(a=document.querySelector("link[rel=stylesheet][href*=accessibility][href*=user-]"))?JSON.stringify(Object.values(r.selected))===JSON.stringify([!1,!1])?a.remove():a.href=a.href.split("?")[0]+"?v="+(new Date).getTime():((l=document.createElement("link")).rel="stylesheet",l.href=(0,s.generateUrl)("/apps/accessibility/css/user-style.css")+"?v="+(new Date).getTime(),document.head.appendChild(l)),i.next=13;break;case 9:i.prev=9,i.t0=i.catch(0),console.error(i.t0,i.t0.response),OC.Notification.showTemporary(t("accessibility",i.t0.response.data.ocs.meta.message+". Unable to apply the setting."));case 13:case"end":return i.stop()}}),i,null,[[0,9]])})),function(){var e=this,t=arguments;return new Promise((function(n,r){var s=i.apply(e,t);function c(e){d(s,n,r,c,o,"next",e)}function o(e){d(s,n,r,c,o,"throw",e)}c(void 0)}))})()}}},p=v,m=(0,l.Z)(p,(function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"section",attrs:{id:"accessibility"}},[n("h2",[e._v(e._s(e.t("accessibility","Accessibility")))]),e._v(" "),n("p",{domProps:{innerHTML:e._s(e.description)}}),e._v(" "),n("p",{domProps:{innerHTML:e._s(e.descriptionDetail)}}),e._v(" "),n("div",{staticClass:"preview-list"},[n("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 n("ItemPreview",{key:t.id,attrs:{preview:t,selected:e.selected.theme},on:{select:e.selectTheme}})})),e._v(" "),e._l(e.fonts,(function(t){return n("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(m))).$mount("#accessibility")}},i={};function r(e){var t=i[e];if(void 0!==t)return t.exports;var s=i[e]={id:e,loaded:!1,exports:{}};return n[e].call(s.exports,s,s.exports,r),s.loaded=!0,s.exports}r.m=n,r.amdD=function(){throw new Error("define cannot be used indirect")},r.amdO={},e=[],r.O=function(t,n,i,s){if(!n){var c=1/0;for(u=0;u<e.length;u++){n=e[u][0],i=e[u][1],s=e[u][2];for(var o=!0,a=0;a<n.length;a++)(!1&s||c>=s)&&Object.keys(r.O).every((function(e){return r.O[e](n[a])}))?n.splice(a--,1):(o=!1,s<c&&(c=s));if(o){e.splice(u--,1);var l=i();void 0!==l&&(t=l)}}return t}s=s||0;for(var u=e.length;u>0&&e[u-1][2]>s;u--)e[u]=e[u-1];e[u]=[n,i,s]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},r.j=189,function(){var e={189:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,s,c=n[0],o=n[1],a=n[2],l=0;if(c.some((function(t){return 0!==e[t]}))){for(i in o)r.o(o,i)&&(r.m[i]=o[i]);if(a)var u=a(r)}for(t&&t(n);l<c.length;l++)s=c[l],r.o(e,s)&&e[s]&&e[s][0](),e[c[l]]=0;return r.O(u)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var s=r.O(void 0,[874],(function(){return r(26795)}));s=r.O(s)}(); +//# sourceMappingURL=accessibility-accessibility.js.map?v=e2ecf600573efafa880e
\ No newline at end of file |