text/js/editor-guest.js

2 строки
6.1 KiB
JavaScript

"use strict";(self.webpackChunk_nextcloud_text=self.webpackChunk_nextcloud_text||[]).push([["editor-guest"],{44666:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(87537),a=s.n(n),r=s(23645),i=s.n(r)()(a());i.push([e.id,".avatar[data-v-1bf0295d],.avatar-wrapper[data-v-1bf0295d]{border-radius:50%;width:var(--size);height:var(--size);text-align:center;color:#fff;line-height:var(--size);font-size:var(--font-size);font-weight:normal;display:flex;justify-content:center;align-items:center}","",{version:3,sources:["webpack://./src/components/Editor/AvatarWrapper.vue"],names:[],mappings:"AAEA,0DACC,iBAAA,CACA,iBAAA,CACA,kBAAA,CACA,iBAAA,CACA,UAAA,CACA,uBAAA,CACA,0BAAA,CACA,kBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA",sourcesContent:["\n\n.avatar, .avatar-wrapper {\n\tborder-radius: 50%;\n\twidth: var(--size);\n\theight: var(--size);\n\ttext-align: center;\n\tcolor: #ffffff;\n\tline-height: var(--size);\n\tfont-size: var(--font-size);\n\tfont-weight: normal;\n\tdisplay: flex;\n\tjustify-content: center;\n\talign-items: center;\n}\n"],sourceRoot:""}]);const o=i},51047:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s(87537),a=s.n(n),r=s(23645),i=s.n(r)()(a());i.push([e.id,"form.guest-name-dialog[data-v-d273994a]{display:flex;align-items:center;padding:6px}form.guest-name-dialog[data-v-d273994a] img{margin:0 !important}form.guest-name-dialog input[type=text][data-v-d273994a]{flex-grow:1}form.guest-name-dialog label[data-v-d273994a]{padding-right:3px;height:32px}","",{version:3,sources:["webpack://./src/components/Editor/GuestNameDialog.vue"],names:[],mappings:"AACA,wCACC,YAAA,CACA,kBAAA,CACA,WAAA,CAEA,4CACC,mBAAA,CAGD,yDACC,WAAA,CAED,8CACC,iBAAA,CACA,WAAA",sourcesContent:["\nform.guest-name-dialog {\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 6px;\n\n\t&:deep(img) {\n\t\tmargin: 0 !important;\n\t}\n\n\tinput[type=text] {\n\t\tflex-grow: 1;\n\t}\n\tlabel {\n\t\tpadding-right: 3px;\n\t\theight: 32px;\n\t}\n}\n"],sourceRoot:""}]);const o=i},20885:(e,t,s)=>{s.d(t,{Z:()=>y});function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),s.push.apply(s,n)}return s}function a(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?n(Object(s),!0).forEach((function(t){r(e,t,s[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))}))}return e}function r(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const i={name:"AvatarWrapper",components:{NcAvatar:s(15961).Xn},props:{session:{type:Object,required:!0},size:{type:Number,default:function(){return 32}}},computed:{sessionAvatarStyle:function(){return a(a({},this.sessionBackgroundStyle),{},{"border-color":this.session.color,"border-width":"2px","border-style":"solid","--size":this.size+"px","--font-size":this.size/2+"px"})},sessionBackgroundStyle:function(){return{"background-color":this.session.userId?this.session.color+" !important":"#b9b9b9"}},guestInitial:function(){return""===this.session.guestName?"?":this.session.guestName.slice(0,1).toUpperCase()}}};var o=s(93379),u=s.n(o),l=s(7795),c=s.n(l),d=s(90569),p=s.n(d),A=s(3565),m=s.n(A),g=s(19216),f=s.n(g),v=s(44589),h=s.n(v),C=s(44666),b={};b.styleTagTransform=h(),b.setAttributes=m(),b.insert=p().bind(null,"head"),b.domAPI=c(),b.insertStyleElement=f();u()(C.Z,b);C.Z&&C.Z.locals&&C.Z.locals;const y=(0,s(51900).Z)(i,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"avatar-wrapper",style:e.sessionAvatarStyle},[e.session.userId?t("NcAvatar",{attrs:{user:e.session.userId?e.session.userId:e.session.guestName,"is-guest":null===e.session.userId,"disable-menu":!0,"show-user-status":!1,"disable-tooltip":!0,size:e.size}}):t("div",{staticClass:"avatar",style:e.sessionBackgroundStyle},[e._v("\n\t\t"+e._s(e.guestInitial)+"\n\t")])],1)}),[],!1,null,"1bf0295d",null).exports},90593:(e,t,s)=>{s.r(t),s.d(t,{default:()=>x});var n=s(15961),a=s(79753),r=s(20885),i=s(31728);const o={name:"GuestNameDialog",components:{AvatarWrapper:r.Z},directives:{tooltip:n.u},mixins:[i.BG],props:{session:{type:Object,required:!0}},data:function(){return{guestName:"",guestNameBuffered:""}},computed:{avatarUrl:function(){var e=(0,a.generateUrl)("/avatar/guest/{user}/{size}",{user:this.guestNameBuffered,size:32});return window.location.protocol+"//"+window.location.host+e}},beforeMount:function(){this.guestName=this.$syncService.session.guestName,this.updateBufferedGuestName()},methods:{setGuestName:function(){var e=this,t=this.$syncService.session.guestName;this.$syncService.updateSession(this.guestName).then((function(){localStorage.setItem("nick",e.guestName),e.updateBufferedGuestName()})).catch((function(s){e.guestName=t}))},updateBufferedGuestName:function(){this.guestNameBuffered=this.guestName}}};var u=s(93379),l=s.n(u),c=s(7795),d=s.n(c),p=s(90569),A=s.n(p),m=s(3565),g=s.n(m),f=s(19216),v=s.n(f),h=s(44589),C=s.n(h),b=s(51047),y={};y.styleTagTransform=C(),y.setAttributes=g(),y.insert=A().bind(null,"head"),y.domAPI=d(),y.insertStyleElement=v();l()(b.Z,y);b.Z&&b.Z.locals&&b.Z.locals;const x=(0,s(51900).Z)(o,(function(){var e=this,t=e._self._c;return t("form",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.t("text","Enter your name so other people can see who is editing"),expression:"t('text', 'Enter your name so other people can see who is editing')"}],staticClass:"guest-name-dialog",on:{submit:function(t){return t.preventDefault(),e.setGuestName()}}},[t("label",[t("AvatarWrapper",{attrs:{session:e.session,size:32}})],1),e._v(" "),t("input",{directives:[{name:"model",rawName:"v-model",value:e.guestName,expression:"guestName"}],attrs:{type:"text","aria-label":e.t("text","Edit guest name"),placeholder:e.t("text","Guest")},domProps:{value:e.guestName},on:{input:function(t){t.target.composing||(e.guestName=t.target.value)}}}),e._v(" "),t("input",{staticClass:"icon-confirm",attrs:{type:"submit","aria-label":e.t("text","Save guest name"),value:""}})])}),[],!1,null,"d273994a",null).exports}}]);
//# sourceMappingURL=editor-guest.js.map?v=3507a7cd9abd897a8d16