You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nextcloud-server/dist/theming-admin-theming.js

2 lines
80 KiB

(()=>{"use strict";var e,n,a,o={56591:(e,n,a)=>{var o=a(21777),r=a(85471),i=a(32981),l=a(40083),s=a(88837),c=a(32073),u=a(65043),d=a(63814);const p=["color","logo","background","logoheader","favicon","disable-user-theming"],h={emits:["update:theming"],data:()=>({showSuccess:!1,errorMessage:""}),computed:{id(){return`admin-theming-${this.name}`}},methods:{reset(){this.showSuccess=!1,this.errorMessage=""},handleSuccess(){this.showSuccess=!0,setTimeout((()=>{this.showSuccess=!1}),2e3),p.includes(this.name)&&this.$emit("update:theming")}}},m={mixins:[h],watch:{value(e){this.localValue=e}},data(){return{localValue:this.value}},computed:{valueToPost(){return"url"===this.type?this.isUrlEncoded(this.localValue)?this.localValue.replaceAll('"',"%22"):encodeURI(this.localValue):"boolean"==typeof this.localValue?this.localValue?"yes":"no":this.localValue}},methods:{isUrlEncoded(e){try{return decodeURI(e)!==e}catch{return!1}},async save(){this.reset();const e=(0,d.Jv)("/apps/theming/ajax/updateStylesheet");try{await u.Ay.post(e,{setting:this.name,value:this.valueToPost}),this.$emit("update:value",this.localValue),this.handleSuccess()}catch(e){console.error("Failed to save changes",e),this.errorMessage=e.response?.data.data?.message}},async undo(){this.reset();const e=(0,d.Jv)("/apps/theming/ajax/undoChanges");try{const{data:t}=await u.Ay.post(e,{setting:this.name});t.data.value&&this.$emit("update:defaultValue",t.data.value),this.$emit("update:value",t.data.value||this.defaultValue),this.handleSuccess()}catch(e){this.errorMessage=e.response.data.data?.message}}}},g={name:"CheckboxField",components:{NcCheckboxRadioSwitch:c.A,NcNoteCard:l.A},mixins:[m],props:{name:{type:String,required:!0},value:{type:Boolean,required:!0},defaultValue:{type:Boolean,required:!0},displayName:{type:String,required:!0},label:{type:String,required:!0},description:{type:String,required:!0}}};var f=a(85072),v=a.n(f),A=a(97825),b=a.n(A),y=a(77659),C=a.n(y),w=a(55056),_=a.n(w),S=a(10540),x=a.n(S),N=a(41113),k=a.n(N),T=a(11579),D={};D.styleTagTransform=k(),D.setAttributes=_(),D.insert=C().bind(null,"head"),D.domAPI=b(),D.insertStyleElement=x(),v()(T.A,D),T.A&&T.A.locals&&T.A.locals;var M=a(14486);const E=(0,M.A)(g,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"field"},[t("label",{attrs:{for:e.id}},[e._v(e._s(e.displayName))]),e._v(" "),t("div",{staticClass:"field__row"},[t("NcCheckboxRadioSwitch",{attrs:{id:e.id,type:"switch",checked:e.localValue},on:{"update:checked":[function(t){e.localValue=t},e.save]}},[e._v("\n\t\t\t"+e._s(e.label)+"\n\t\t")])],1),e._v(" "),t("p",{staticClass:"field__description"},[e._v("\n\t\t"+e._s(e.description)+"\n\t")]),e._v(" "),e.errorMessage?t("NcNoteCard",{attrs:{type:"error","show-alert":!0}},[t("p",[e._v(e._s(e.errorMessage))])]):e._e()],1)}),[],!1,null,"b7d201f6",null).exports;var I={grad:.9,turn:360,rad:360/(2*Math.PI)},P=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},L=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},O=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},F=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},B=function(e){return{r:O(e.r,0,255),g:O(e.g,0,255),b:O(e.b,0,255),a:O(e.a)}},j=function(e){return{r:L(e.r),g:L(e.g),b:L(e.b),a:L(e.a,3)}},R=/^#([0-9a-f]{3,8})$/i,U=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},z=function(e){var t=e.r,n=e.g,a=e.b,o=e.a,r=Math.max(t,n,a),i=r-Math.min(t,n,a),l=i?r===t?(n-a)/i:r===n?2+(a-t)/i:4+(t-n)/i:0;return{h:60*(l<0?l+6:l),s:r?i/r*100:0,v:r/255*100,a:o}},V=function(e){var t=e.h,n=e.s,a=e.v,o=e.a;t=t/360*6,n/=100,a/=100;var r=Math.floor(t),i=a*(1-n),l=a*(1-(t-r)*n),s=a*(1-(1-t+r)*n),c=r%6;return{r:255*[a,l,i,i,s,a][c],g:255*[s,a,a,l,i,i][c],b:255*[i,i,s,a,a,l][c],a:o}},Y=function(e){return{h:F(e.h),s:O(e.s,0,100),l:O(e.l,0,100),a:O(e.a)}},X=function(e){return{h:L(e.h),s:L(e.s),l:L(e.l),a:L(e.a,3)}},$=function(e){return V((n=(t=e).s,{h:t.h,s:(n*=((a=t.l)<50?a:100-a)/100)>0?2*n/(a+n)*100:0,v:a+n,a:t.a}));var t,n,a},H=function(e){return{h:(t=z(e)).h,s:(o=(200
//# sourceMappingURL=theming-admin-theming.js.map?v=4d52f1867337ada53d0b