text/js/editor-collab.js

23 строки
21 KiB
JavaScript
Исходник Обычный вид История

(window.textWebpackJsonp=window.textWebpackJsonp||[]).push([[195],{262:function(t,n,r){"use strict";r.r(n);var o=r(263),e=r.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){r.d(n,t,(function(){return o[t]}))}(a);n.default=e.a},263:function(r,o,e){"use strict";Object.defineProperty(o,"__esModule",{value:!0}),o.default=void 0;var a=l(e(431)),i=l(e(881)),s=l(e(178)),c=l(e(405));function l(t){return t&&t.__esModule?t:{default:t}}var p={name:"SessionList",components:{Avatar:a.default,Popover:i.default},directives:{tooltip:s.default},mixins:[c.default],props:{sessions:{type:Object,default:()=>({})}},data:()=>({myName:""}),computed:{showAuthorAnnotations:{get(){return this.$store.state.showAuthorAnnotations},set(t){this.$store.dispatch("setShowAuthorAnnotations",t)}},editorsTooltip(){const r=t("text","Currently active users:")+" ";if(this.sessionPopoverList.length>0){const t=this.activeSessions.slice(0,3).map(t=>t.guestName?t.guestName:t.displayName).join(", "),o=this.activeSessions.slice(3).length;return r+t+" "+n("text","and %n other editor","and %n other editors",o)}return r+this.activeSessions.slice(0,3).map(t=>t.guestName?t.guestName:t.displayName).join(", ")},activeSessions(){return Object.values(this.sessions).filter(t=>t.lastContact>Date.now()/1e3-90&&!t.isCurrent&&(null!==t.userId||null!==t.guestName)).sort((t,n)=>t.lastContact<n.lastContact)},currentSession(){return Object.values(this.sessions).find(t=>t.isCurrent)},sessionStyle:()=>t=>({"border-color":t.color,"background-color":t.color+" !important"}),avatarStyle:()=>t=>({opacity:t.lastContact>Date.now()/1e3-60?1:.5}),sessionsVisible(){return this.activeSessions.slice(0,3)},sessionPopoverList(){return this.activeSessions.slice(3)}}};o.default=p},880:function(t,n,r){"use strict";r.r(n);var o=r(900),e=r(262);for(var a in e)["default"].indexOf(a)<0&&function(t){r.d(n,t,(function(){return e[t]}))}(a);r(901);var i=r(12),s=Object(i.a)(e.default,o.a,o.b,!1,null,"00554982",null);n.default=s.exports},881:function(t,n,r){"use strict";window,t.exports=function(t){var n={};function r(o){if(n[o])return n[o].exports;var e=n[o]={i:o,l:!1,exports:{}};return t[o].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=t,r.c=n,r.d=function(t,n,o){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var e in t)r.d(o,e,function(n){return t[n]}.bind(null,e));return o},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="/dist/",r(r.s=47)}({0:function(t,n,r){function o(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],o=!0,e=!1,a=void 0;try{for(var i,s=t[Symbol.iterator]();!(o=(i=s.next()).done)&&(r.push(i.value),!n||r.length!==n);o=!0);}catch(t){e=!0,a=t}finally{try{o||null==s.return||s.return()}finally{if(e)throw a}}return r}}(t,n)||function(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,n){(null==n||n>t.length)&&(n=t.length);for(var r=0,o=new Array(n);r<n;r++)o[r]=t[r];return o}t.exports=function(t){var n=o(t,4),r=n[1],e=n[3];if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(e)))),i="sourceMappingURL=data:appli
/**
* @copyright Copyright (c) 2019 Marco Ambrosini <marcoambrosini@pm.me>
*
* @author Marco Ambrosini <marcoambrosini@pm.me>
*
* @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/>.
*
*/n.default=o.a},7:function(t,n){t.exports=r(179)}})},882:function(t,n,r){"use strict";var o=r(20),e=r.n(o),a=r(21),i=r.n(a)()(e.a);i.push([t.i,".avatar-list[data-v-00554982]{border:none;background-color:var(--color-main-background);padding:0;margin:0;padding-left:6px;display:inline-flex;flex-direction:row-reverse}.avatar-list[data-v-00554982]:focus{background-color:#eee}.avatar-list .avatar-wrapper[data-v-00554982]{margin:6px;margin-right:-8px;margin-left:0}.avatar-list .icon-more[data-v-00554982],.avatar-list .icon-group[data-v-00554982],.avatar-list .icon-settings-dark[data-v-00554982]{background-color:var(--color-background-dark);width:36px;height:36px;margin:6px 6px 6px 0px}.avatar-wrapper[data-v-00554982]{width:32px;height:32px;z-index:1;border-radius:50%;overflow:hidden;border:2px solid var(--color-main-background);box-sizing:content-box !important}.session-menu[data-v-00554982]{max-width:280px;padding-top:6px;padding-bottom:6px}.session-menu ul li[data-v-00554982]{align-items:center;display:flex;padding:6px}.session-menu ul li .avatar-wrapper[data-v-00554982]{margin-right:6px}label[data-v-00554982]{display:block;margin:8px}.hint[data-v-00554982]{margin:8px;color:var(--color-text-maxcontrast)}\n","",{version:3,sources:["webpack://./src/components/SessionList.vue"],names:[],mappings:"AA8JA,8BACC,WAAY,CACZ,6CAA8C,CAC9C,SAAU,CACV,QAAS,CACT,gBAAiB,CACjB,mBAAoB,CACpB,0BAA2B,CAP5B,oCAUE,qBAAsB,CAVxB,8CAcE,UAAW,CACX,iBAAkB,CAClB,aAAc,CAhBhB,qIAoBE,6CAA8C,CAC9C,UAAW,CACX,WAAY,CACZ,sBAAuB,CACvB,iCAID,UAAW,CACX,WAAY,CACZ,SAAU,CACV,iBAAkB,CAClB,eAAgB,CAChB,6CAA8C,CAC9C,iCAAkC,CAClC,+BAGA,eAAgB,CAChB,eAAgB,CAChB,kBAAmB,CAHpB,qCAME,kBAAmB,CACnB,YAAa,CACb,WAAY,CARd,qDAWG,gBAAiB,CACjB,uBAKF,aAAc,CACd,UAAW,CACX,uBAGA,UAAW,CACX,mCAAoC",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.avatar-list {\n\tborder: none;\n\tbackground-color: var(--color-main-background);\n\tpadding: 0;\n\tmargin: 0;\n\tpadding-left: 6px;\n\tdisplay: inline-flex;\n\tflex-direction: row-reverse;\n\n\t&:focus {\n\t\tbackground-color: #eee;\n\t}\n\n\t.avatar-wrapper {\n\t\tmargin: 6px;\n\t\tmargin-right: -8px;\n\t\tmargin-left: 0;\n\t}\n\n\t.icon-more, .icon-group, .icon-settings-dark {\n\t\tbackground-color: var(--color-background-dark);\n\t\twidth: 36px;\n\t\theight: 36px;\n\t\tmargin: 6px 6px 6px 0px;\n\t}\n}\n\n.avatar-wrapper {\n\twidth: 32px;\n\theight: 32px;\n\tz-index: 1;\n\tborder-radius: 50%;\n\toverflow: hidden;\n\tborder: 2px solid var(--color-main-background);\n\tbox-sizing: content-box !important;\n}\n\n.session-menu {\n\tmax-width: 280px;\n\tpadding-top: 6px;\n\tpadding-bottom: 6px;\n\n\tul li {\n\t\talign-items: center;\n\t\tdisplay: flex;\n\t\tpadding: 6px;\n\n\t\t.avatar-wrapper {\n\t\t\tmargin-right: 6px;\n\t\t}\n\t}\n}\n\nlabel {\n\tdisplay: block;\n\tmargin: 8px;\n}\n\n.hint {\n\tmargin: 8px;\n\tcolor: var(--color-text-maxcontrast);\n}\n"],sourceRoot:""}]),n.a=i},900:function(t,n,r){"use strict";r.d(n,"a",(function(){return o})),r.d(n,"b",(function(){return e}));var o=function(){var t=this,n=t.$createElement,r=t._self._c||n;return r("Popover",{staticClass:"session-list",attrs:{placement:"top"}},[r("button",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:t.editorsTooltip,expression:"editorsTooltip",modifiers:{bottom:!0}}],staticClass:"avatar-list",attrs:{slot:"trigger"},slot:"trigger"},[r("div",{staticClass:"avatardiv icon-group"}),t._v(" "),t._l(t.sessionsVisible,(function(n){return r("div",{key:n.id,staticClass:"avatar-wrapper",style:t.sessionStyle(n)},[r("Avatar",{style:t.avatarStyle(n),attrs:{user:n.userId?n.userId:n.guestName,"is-guest":null===n.userId,"disable-menu":!0,"show-user-status":!1,"disable-tooltip":!0,size:32}})],1)}))],2),t._v(" "),[r("div",{staticClass:"session-menu"},[r("ul",[t._t("default"),t._v(" "),t._l(t.sessionPop
//# sourceMappingURL=editor-collab.js.map?v=ce205fa1a3bbabebd71f