nextcloud/apps/settings/js/vue-6.js

29 lines
69 KiB
JavaScript
Raw Normal View History

(window.webpackJsonpSettings=window.webpackJsonpSettings||[]).push([[6],{318:function(e,t){function s(e){return"function"==typeof e.value||(console.warn("[Vue-click-outside:] provided expression",e.expression,"is not a function."),!1)}function i(e){return void 0!==e.componentInstance&&e.componentInstance.$isServer}e.exports={bind:function(e,t,n){function a(t){if(n.context){var s=t.path||t.composedPath&&t.composedPath();s&&s.length>0&&s.unshift(t.target),e.contains(t.target)||function(e,t){if(!e||!t)return!1;for(var s=0,i=t.length;s<i;s++)try{if(e.contains(t[s]))return!0;if(t[s].contains(e))return!1}catch(e){return!1}return!1}(n.context.popupItem,s)||e.__vueClickOutside__.callback(t)}}s(t)&&(e.__vueClickOutside__={handler:a,callback:t.value},!i(n)&&document.addEventListener("click",a))},update:function(e,t){s(t)&&(e.__vueClickOutside__.callback=t.value)},unbind:function(e,t,s){!i(s)&&document.removeEventListener("click",e.__vueClickOutside__.handler),delete e.__vueClickOutside__}}},319:function(e,t,s){
/*!
* vue-infinite-loading v2.4.4
* (c) 2016-2019 PeachScript
* MIT License
*/
e.exports=function(e){var t={};function s(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,s),n.l=!0,n.exports}return s.m=e,s.c=t,s.d=function(e,t,i){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(s.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)s.d(i,n,function(t){return e[t]}.bind(null,n));return i},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=9)}([function(e,t,s){var i=s(6);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals),(0,s(3).default)("09280948",i,!0,{})},function(e,t,s){var i=s(8);"string"==typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals),(0,s(3).default)("51e4c3f9",i,!0,{})},function(e,t){e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s=function(e,t){var s,i=e[1]||"",n=e[3];if(!n)return i;if(t&&"function"==typeof btoa){var a=(s=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=n.sources.map((function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"}));return[i].concat(r).concat([a]).join("\n")}return[i].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+s+"}":s})).join("")},t.i=function(e,s){"string"==typeof e&&(e=[[null,e,""]]);for(var i={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(i[a]=!0)}for(n=0;n<e.length;n++){var r=e[n];"number"==typeof r[0]&&i[r[0]]||(s&&!r[2]?r[2]=s:s&&(r[2]="("+r[2]+") and ("+s+")"),t.push(r))}},t}},function(e,t,s){"use strict";function i(e,t){for(var s=[],i={},n=0;n<t.length;n++){var a=t[n],r=a[0],o={id:e+":"+n,css:a[1],media:a[2],sourceMap:a[3]};i[r]?i[r].parts.push(o):s.push(i[r]={id:r,parts:[o]})}return s}s.r(t),s.d(t,"default",(function(){return h}));var n="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!n)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var a={},r=n&&(document.head||document.getElementsByTagName("head")[0]),o=null,l=0,u=!1,d=function(){},c=null,p="data-vue-ssr-id",g="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());function h(e,t,s,n){u=s,c=n||{};var r=i(e,t);return f(r),function(t){for(var s=[],n=0;n<r.length;n++){var o=r[n];(l=a[o.id]).refs--,s.push(l)}for(t?f(r=i(e,t)):r=[],n=0;n<s.length;n++){var l;if(0===(l=s[n]).refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete a[l.id]}}}}function f(e){for(var t=0;t<e.length;t++){var s=e[t],i=a[s.id];if(i){i.refs++;for(var n=0;n<i.parts.length;n++)i.parts[n](s.parts[n]);for(;n<s.parts.length;n++)i.parts.push(v(s.parts[n]));i.parts.length>s.parts.length&&(i.parts.length=s.parts.length)}else{var r=[];for(n=0;n<s.parts.length;n++)r.push(v(s.parts[n]));a[s.id]={id:s.id,refs:1,parts:r}}}}function m(){var e=document.createElement("style");return e.type="text/css",r.appendChild(e),e}function v(e){var t,s,i=document.querySelector("style["+p+'~="'+e.id+'"]');if(i){if(u)return d;i.parentNode.removeChild(i)}if(g){var n=l++;i=o||(o=m()),t=y.bind(null,i,n,!1),s=y.bind(null,i,n,!0)}else i=m(),t=function(e,t){var s=t.css,i=t.media,n=t.sourceMap;if(i&&e.setAttribute("media",i),c.ssrId&&e.setAttribute(p,t.id),n&&(s+="\n/*# sourceURL="+n.sources[0]+" */",s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */"),e.styleSheet)e.styleSheet.cssText=s;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(s))}}.bind(null,i),s=function(){i.p
/**
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
*
* @author John Molakvoæ <skjnldsv@protonmail.com>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/var g={props:{user:{type:Object,required:!0},settings:{type:Object,default:function(){return{}}},groups:{type:Array,default:function(){return[]}},subAdminsGroups:{type:Array,default:function(){return[]}},quotaOptions:{type:Array,default:function(){return[]}},showConfig:{type:Object,default:function(){return{}}},languages:{type:Array,required:!0},externalActions:{type:Array,default:function(){return[]}}},computed:{userGroups:function(){var e=this,t=this.groups.filter((function(t){return e.user.groups.includes(t.id)}));return t},userSubAdminsGroups:function(){var e=this,t=this.subAdminsGroups.filter((function(t){return e.user.subadmin.includes(t.id)}));return t},availableGroups:function(){var e=this;return this.groups.map((function(t){var s=Object.assign({},t);return s.$isDisabled=!1===t.canAdd&&!e.user.groups.includes(t.id)||!1===t.canRemove&&e.user.groups.includes(t.id),s}))},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},usedQuota:function(){var e=this.user.quota.quota;e>0?e=Math.min(100,Math.round(this.user.quota.used/e*100)):e=95*(1-1/(this.user.quota.used/(10*Math.pow(2,30))+1));return isNaN(e)?0:e},userQuota:function(){if(this.user.quota.quota>=0){var e=OC.Util.humanFileSize(this.user.quota.quota),t=this.quotaOptions.find((function(t){return t.id===e}));return t||{id:e,label:e}}return"default"===this.user.quota.quota?this.quotaOptions[0]:this.quotaOptions[1]},minPasswordLength:function(){return this.$store.getters.getPasswordPolicyMinLength},userLanguage:function(){var e=this,t=this.languages[0].languages.concat(this.languages[1].languages).find((function(t){return t.code===e.user.language}));return"object"!==p(t)&&""!==this.user.language?{code:this.user.language,name:this.user.language}:""!==this.user.language&&t},userLastLoginTooltip:function(){return this.user.lastLogin>0?OC.Util.formatDate(this.user.lastLogin):""},userLastLogin:function(){return this.user.lastLogin>0?OC.Util.relativeModifiedDate(this.user.lastLogin):t("settings","Never")}},methods:{generateAvatar:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:32;return OC.generateUrl("/avatar/{user}/{size}?v={version}",{user:e,size:t,version:oc_userconfig.avatar.version})}}},h={name:"UserRowSimple",components:{PopoverMenu:o.PopoverMenu,ActionButton:o.ActionButton,Actions:o.Actions},directives:{ClickOutside:u.a},mixins:[g],props:{user:{type:Object,required:!0},loading:{type:Object,required:!0},showConfig:{type:Object,required:!0},userActions:{type:Array,required:!0},openedMenu:{type:Boolean,required:!0},feedbackMessage:{type:String,required:!0},subAdminsGroups:{type:Array,required:!0},settings:{type:Object,required:!0}},computed:{userGroupsLabels:function(){return this.userGroups.map((function(e){return e.name})).join(", ")},userSubAdminsGroupsLabels:function(){return this.userSubAdminsGroups.map((function(e){return e.name})).join(", ")},usedSpace:function(){return this.user.quota.used?t("settings","{size} used",{size:OC.Util.humanFileSize(this.user.quota.used)}):t("settings","{size} used",{size:OC.Util.humanFileSize(0)})},canEdit:function(){return Object(c.getCurrentUser)().uid!==this.user.id&&"admin"!==this.user.id}},methods:{hideMenu:function(){this.$emit("hideMenu")},toggleEdit:function(){this.$emit("update:editing",!0)}}},f=i(26),m=Object(f.a)(h,(function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"row",class:{disabled:e.loading.delete||e.loading.disable},attrs:{"data-id":e.user.id}},[s("div",{staticClass:"avatar",class:{"icon-loading-small":e.loading.delete||e.loading.disable||e.loading.wipe}},[e.loading.delete||e.loading.disable||e.loading.wipe?e._e():s("img",{attrs:{alt:"",width:"32",height:"32",src:e.generateAvatar(e.user.id,32),srcset:e.generateAvatar(e.user.id,64)+" 2x, "+e.generateAvatar(e.user.id,128)+" 4x"}})]),e._v(" "),s("div",{staticClass:"name"},[e._v("\n\t\t"+e._s(e.user.id)+"\n\t\t"),s("div",{staticClass:"displayName subtitle"},[e._v("\n\t\t\
//# sourceMappingURL=vue-6.js.map?v=513d7884f7066d3aab7f