nextcloud/apps/settings/js/vue-editor-collab.js

375 lines
23 KiB
JavaScript
Raw Normal View History

(window["webpackJsonpSettings"] = window["webpackJsonpSettings"] || []).push([["editor-collab"],{
/***/ "./apps/text/src/components/SessionList.vue":
/*!**************************************************!*\
!*** ./apps/text/src/components/SessionList.vue ***!
\**************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _SessionList_vue_vue_type_template_id_32621e4e_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SessionList.vue?vue&type=template&id=32621e4e&scoped=true& */ "./apps/text/src/components/SessionList.vue?vue&type=template&id=32621e4e&scoped=true&");
/* harmony import */ var _SessionList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SessionList.vue?vue&type=script&lang=js& */ "./apps/text/src/components/SessionList.vue?vue&type=script&lang=js&");
/* empty/unused harmony star reexport *//* harmony import */ var _SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss& */ "./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss&");
/* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js");
/* normalize component */
var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_3__["default"])(
_SessionList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"],
_SessionList_vue_vue_type_template_id_32621e4e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"],
_SessionList_vue_vue_type_template_id_32621e4e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"],
false,
null,
"32621e4e",
null
)
/* hot reload */
if (false) { var api; }
component.options.__file = "apps/text/src/components/SessionList.vue"
/* harmony default export */ __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ "./apps/text/src/components/SessionList.vue?vue&type=script&lang=js&":
/*!***************************************************************************!*\
!*** ./apps/text/src/components/SessionList.vue?vue&type=script&lang=js& ***!
\***************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib!../../../../node_modules/vue-loader/lib??vue-loader-options!./SessionList.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=script&lang=js&");
/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]);
/***/ }),
/***/ "./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss&":
/*!************************************************************************************************************!*\
!*** ./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss& ***!
\************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-style-loader!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib??vue-loader-options!./SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss& */ "./node_modules/vue-style-loader/index.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss&");
/* harmony import */ var _node_modules_vue_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== 'default') (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/* harmony default export */ __webpack_exports__["default"] = (_node_modules_vue_style_loader_index_js_node_modules_css_loader_dist_cjs_js_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_style_index_0_id_32621e4e_scoped_true_lang_scss___WEBPACK_IMPORTED_MODULE_0___default.a);
/***/ }),
/***/ "./apps/text/src/components/SessionList.vue?vue&type=template&id=32621e4e&scoped=true&":
/*!*********************************************************************************************!*\
!*** ./apps/text/src/components/SessionList.vue?vue&type=template&id=32621e4e&scoped=true& ***!
\*********************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_template_id_32621e4e_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./SessionList.vue?vue&type=template&id=32621e4e&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=template&id=32621e4e&scoped=true&");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_template_id_32621e4e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; });
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_SessionList_vue_vue_type_template_id_32621e4e_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; });
/***/ }),
/***/ "./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=script&lang=js&":
/*!*************************************************************************************************************************************************************!*\
!*** ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./apps/text/src/components/SessionList.vue?vue&type=script&lang=js& ***!
\*************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _nextcloud_vue_dist_Components_Avatar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @nextcloud/vue/dist/Components/Avatar */ "./node_modules/@nextcloud/vue/dist/Components/Avatar.js");
/* harmony import */ var _nextcloud_vue_dist_Components_Avatar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_nextcloud_vue_dist_Components_Avatar__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _nextcloud_vue_dist_Components_PopoverMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @nextcloud/vue/dist/Components/PopoverMenu */ "./node_modules/@nextcloud/vue/dist/Components/PopoverMenu.js");
/* harmony import */ var _nextcloud_vue_dist_Components_PopoverMenu__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_nextcloud_vue_dist_Components_PopoverMenu__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _nextcloud_vue_dist_Directives_Tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @nextcloud/vue/dist/Directives/Tooltip */ "./node_modules/@nextcloud/vue/dist/Directives/Tooltip.js");
/* harmony import */ var _nextcloud_vue_dist_Directives_Tooltip__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_nextcloud_vue_dist_Directives_Tooltip__WEBPACK_IMPORTED_MODULE_2__);
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(n); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
var COLLABORATOR_IDLE_TIME = 10;
var COLLABORATOR_DISCONNECT_TIME = 30;
/* harmony default export */ __webpack_exports__["default"] = ({
name: 'SessionList',
components: {
Avatar: _nextcloud_vue_dist_Components_Avatar__WEBPACK_IMPORTED_MODULE_0___default.a,
PopoverMenu: _nextcloud_vue_dist_Components_PopoverMenu__WEBPACK_IMPORTED_MODULE_1___default.a
},
directives: {
tooltip: _nextcloud_vue_dist_Directives_Tooltip__WEBPACK_IMPORTED_MODULE_2___default.a
},
props: {
sessions: {
type: Object,
default: function _default() {
return {};
}
}
},
data: function data() {
return {
popoverVisible: '',
myName: ''
};
},
computed: {
editorsTooltip: function editorsTooltip() {
if (this.sessionsPopover.length > 0) {
var first = this.activeSessions.slice(0, 3).map(function (session) {
return session.guestName ? session.guestName : session.displayName;
}).join(', ');
var others = this.activeSessions.slice(3).length;
return first + ' ' + n('text', 'and %n other editor', 'and %n other editors', others);
}
return this.activeSessions.slice(0, 3).map(function (session) {
return session.guestName ? session.guestName : session.displayName;
}).join(', ');
},
avatarUrl: function avatarUrl() {
return function (session) {
var user = !session.guestName ? session.userId : session.guestName;
var size = 32;
var guest = !!session.guestName;
var avatarUrl = OC.generateUrl(guest ? '/avatar/guest/{user}/{size}' : '/avatar/{user}/{size}', {
user: user,
size: size
});
return window.location.protocol + '//' + window.location.host + avatarUrl;
};
},
activeSessions: function activeSessions() {
return Object.values(this.sessions).filter(function (session) {
return session.lastContact > Date.now() / 1000 - COLLABORATOR_DISCONNECT_TIME && !session.isCurrent && (session.userId !== null || session.guestName !== null);
});
},
currentSession: function currentSession() {
return Object.values(this.sessions).find(function (session) {
return session.isCurrent;
});
},
sessionStyle: function sessionStyle() {
return function (session) {
return {
'opacity': session.lastContact > Date.now() / 1000 - COLLABORATOR_IDLE_TIME ? 1 : 0.5 // 'border-color': session.color
};
};
},
sessionsVisible: function sessionsVisible() {
return this.activeSessions.slice(0, 3);
},
sessionsPopover: function sessionsPopover() {
var _this = this;
return _toConsumableArray(this.activeSessions.slice(3).map(function (session) {
return {
href: '#',
icon: _this.avatarUrl(session),
text: session.guestName ? session.guestName : session.displayName
};
}));
}
},
methods: {}
});
/***/ }),
/***/ "./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss&":
/*!****************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss& ***!
\****************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
exports = ___CSS_LOADER_API_IMPORT___(false);
// Module
exports.push([module.i, ".session-list[data-v-32621e4e] {\n position: relative;\n}\n.session-list[data-v-32621e4e] .popovermenu {\n margin-right: -4px;\n}\n.session-list[data-v-32621e4e] .popovermenu img {\n padding: 0;\n width: 32px !important;\n height: 32px !important;\n margin: 6px;\n border-radius: 50%;\n}\n.avatar-list[data-v-32621e4e] {\n display: inline-flex;\n flex-direction: row-reverse;\n}\n.avatar-list .avatardiv[data-v-32621e4e],\n .avatar-list[data-v-32621e4e] .avatardiv {\n width: 36px;\n height: 36px;\n margin-right: -8px;\n border: 2px solid var(--color-main-background);\n background-color: var(--color-main-background) !important;\n box-sizing: content-box !important;\n}\n.avatar-list .avatardiv.icon-more[data-v-32621e4e],\n .avatar-list[data-v-32621e4e] .avatardiv.icon-more {\n width: 32px;\n height: 32px;\n opacity: .5;\n background-color: var(--color-background-dark) !important;\n cursor: pointer;\n}\n.popovermenu[data-v-32621e4e] {\n display: block;\n}\n", ""]);
// Exports
module.exports = exports;
/***/ }),
/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=template&id=32621e4e&scoped=true&":
/*!***************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./apps/text/src/components/SessionList.vue?vue&type=template&id=32621e4e&scoped=true& ***!
\***************************************************************************************************************************************************************************************************************************/
/*! exports provided: render, staticRenderFns */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; });
var render = function() {
var _vm = this
var _h = _vm.$createElement
var _c = _vm._self._c || _h
return _c("div", { staticClass: "session-list" }, [
_c(
"div",
{
directives: [
{
name: "tooltip",
rawName: "v-tooltip.bottom",
value: _vm.editorsTooltip,
expression: "editorsTooltip",
modifiers: { bottom: true }
}
],
staticClass: "avatar-list",
on: {
click: function($event) {
_vm.popoverVisible = !_vm.popoverVisible
}
}
},
[
_vm.sessionsPopover.length > 0
? _c("div", { staticClass: "avatardiv icon-more" })
: _vm._e(),
_vm._v(" "),
_vm._l(_vm.sessionsVisible, function(session) {
return _c("Avatar", {
key: session.id,
style: _vm.sessionStyle(session),
attrs: {
user: session.userId ? session.userId : session.guestName,
"is-guest": session.userId === null,
"disable-tooltip": true,
size: 32
}
})
})
],
2
),
_vm._v(" "),
_c(
"div",
{
directives: [
{
name: "show",
rawName: "v-show",
value: _vm.popoverVisible,
expression: "popoverVisible"
}
],
staticClass: "popovermenu menu-right"
},
[
_c("PopoverMenu", { attrs: { menu: _vm.sessionsPopover } }),
_vm._v(" "),
_vm._t("default")
],
2
)
])
}
var staticRenderFns = []
render._withStripped = true
/***/ }),
/***/ "./node_modules/vue-style-loader/index.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss&":
/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
!*** ./node_modules/vue-style-loader!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib??vue-loader-options!./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss& ***!
\************************************************************************************************************************************************************************************************************************************************************************************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(/*! !../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib??vue-loader-options!./SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss& */ "./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/lib/index.js?!./apps/text/src/components/SessionList.vue?vue&type=style&index=0&id=32621e4e&scoped=true&lang=scss&");
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__(/*! ../../../../node_modules/vue-style-loader/lib/addStylesClient.js */ "./node_modules/vue-style-loader/lib/addStylesClient.js").default
var update = add("ddf5505e", content, false, {});
// Hot Module Replacement
if(false) {}
/***/ })
}]);
//# sourceMappingURL=vue-editor-collab.js.map?v=ea46162cd01c4d879032