From c5be0707cfd024ef064d00b328562d247fb7eef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Farr=C3=A9?= Date: Sun, 21 Jul 2024 18:50:07 +0200 Subject: [PATCH] Enh #406: Change conversation height calculation from Javascript to CSS --- docs/CHANGELOG.md | 4 + module.json | 2 +- package-lock.json | 378 ++++++++++-------- resources/css/humhub.mail.css | 37 +- resources/css/humhub.mail.less | 44 +- resources/css/humhub.mail.min.css | 2 +- resources/js/humhub.mail.ConversationView.js | 58 +-- resources/js/humhub.mail.inbox.js | 99 ++--- resources/js/humhub.mail.messenger.bundle.js | 163 +++----- .../js/humhub.mail.messenger.bundle.min.js | 2 +- resources/js/humhub.mail.notification.min.js | 2 +- views/mail/conversation.php | 102 ++--- 12 files changed, 439 insertions(+), 454 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 66d42102..8ffac827 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +Unreleased +-------------------- +- Enh #406: Change conversation height calculation from Javascript to CSS + 3.2.2 (July 9, 2024) -------------------- - Enh #382: Implement provider for meta searching diff --git a/module.json b/module.json index ad941cb2..20232b29 100644 --- a/module.json +++ b/module.json @@ -10,7 +10,7 @@ ], "version": "3.2.2", "humhub": { - "minVersion": "1.16" + "minVersion": "1.17" }, "homepage": "https://github.com/humhub/mail", "authors": [ diff --git a/package-lock.json b/package-lock.json index 9dd46663..7ac9ffcb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -69,9 +69,9 @@ } }, "node_modules/async": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.4.tgz", - "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", "dev": true }, "node_modules/balanced-match": { @@ -121,13 +121,19 @@ "dev": true }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -219,9 +225,9 @@ } }, "node_modules/dateformat": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", "dev": true, "engines": { "node": "*" @@ -236,6 +242,23 @@ "ms": "^2.1.1" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/detect-file": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", @@ -273,6 +296,27 @@ "string-template": "~0.2.1" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -366,31 +410,18 @@ } }, "node_modules/findup-sync": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.3.0.tgz", - "integrity": "sha512-z8Nrwhi6wzxNMIbxlrTzuUW6KWuKkogZ/7OdDVq+0+kxn77KUH1nipx8iU6suqkHqc4y6n7a9A8IpmxY/pTjWg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-5.0.0.tgz", + "integrity": "sha512-MzwXju70AuyflbgeOhzvQWAvvQdo1XL0A9bVvlXsYcFEBM87WR4OakL4OfZq+QRmr+duJubio+UtNQCPsVESzQ==", "dev": true, "dependencies": { - "glob": "~5.0.0" - }, - "engines": { - "node": ">= 0.6.0" - } - }, - "node_modules/findup-sync/node_modules/glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", - "dev": true, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "detect-file": "^1.0.0", + "is-glob": "^4.0.3", + "micromatch": "^4.0.4", + "resolve-dir": "^1.0.1" }, "engines": { - "node": "*" + "node": ">= 10.13.0" } }, "node_modules/fined": { @@ -446,10 +477,13 @@ "dev": true }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gaze": { "version": "1.1.3", @@ -464,14 +498,19 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -490,6 +529,7 @@ "version": "7.1.7", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -562,40 +602,50 @@ "node": ">= 0.10" } }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true, "optional": true }, "node_modules/grunt": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.5.3.tgz", - "integrity": "sha512-mKwmo4X2d8/4c/BmcOETHek675uOqw0RuA/zy12jaspWqvTp4+ZeQF1W+OTpcbncnaBsfbQJ6l0l4j+Sn/GmaQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/grunt/-/grunt-1.6.1.tgz", + "integrity": "sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==", "dev": true, "dependencies": { - "dateformat": "~3.0.3", + "dateformat": "~4.6.2", "eventemitter2": "~0.4.13", "exit": "~0.1.2", - "findup-sync": "~0.3.0", + "findup-sync": "~5.0.0", "glob": "~7.1.6", "grunt-cli": "~1.4.3", "grunt-known-options": "~2.0.0", "grunt-legacy-log": "~3.0.0", "grunt-legacy-util": "~2.0.1", - "iconv-lite": "~0.4.13", + "iconv-lite": "~0.6.3", "js-yaml": "~3.14.0", "minimatch": "~3.0.4", - "mkdirp": "~1.0.4", - "nopt": "~3.0.6", - "rimraf": "~3.0.2" + "nopt": "~3.0.6" }, "bin": { "grunt": "bin/grunt" }, "engines": { - "node": ">=8" + "node": ">=16" } }, "node_modules/grunt-cli": { @@ -997,18 +1047,6 @@ "node": ">=0.12.0" } }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -1030,6 +1068,30 @@ "node": ">=4" } }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", @@ -1042,6 +1104,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", @@ -1070,12 +1144,12 @@ "dev": true }, "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { "node": ">=0.10.0" @@ -1098,6 +1172,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "dependencies": { "once": "^1.3.0", @@ -1136,12 +1211,15 @@ } }, "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", + "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1266,9 +1344,9 @@ } }, "node_modules/less": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/less/-/less-4.1.3.tgz", - "integrity": "sha512-w16Xk/Ta9Hhyei0Gpz9m7VS8F28nieJaL/VyShID7cYvP6IL5oHeL6p4TXSDJqZE/lNv0oJ2pGVjJsRkfwm5FA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/less/-/less-4.2.0.tgz", + "integrity": "sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA==", "dev": true, "dependencies": { "copy-anything": "^2.0.1", @@ -1398,12 +1476,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -1435,18 +1513,6 @@ "node": "*" } }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -1454,13 +1520,12 @@ "dev": true }, "node_modules/needle": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-3.2.0.tgz", - "integrity": "sha512-oUvzXnyLiVyVGoianLijF9O/RecZUf7TkBfimjGrLM4eQhXyeJwM6GeAWccwfQ9aa4gMCZKqhAOuLaMIcQxajQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-3.3.1.tgz", + "integrity": "sha512-6k0YULvhpw+RoLNiQCRKOl09Rv1dPLr8hHnVjHqdolKwDrdNyk+Hmrthi4lIGPPz3r39dLx0hsF5s40sZ3Us4Q==", "dev": true, "optional": true, "dependencies": { - "debug": "^3.2.6", "iconv-lite": "^0.6.3", "sax": "^1.2.4" }, @@ -1471,19 +1536,6 @@ "node": ">= 4.4.x" } }, - "node_modules/needle/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "dev": true, - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", @@ -1515,10 +1567,13 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -1594,6 +1649,7 @@ "version": "0.1.5", "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "deprecated": "This package is no longer supported.", "dev": true, "dependencies": { "os-homedir": "^1.0.0", @@ -1710,12 +1766,12 @@ "optional": true }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.12.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.3.tgz", + "integrity": "sha512-AWJm14H1vVaO/iNZ4/hO+HyaTehuy9nRqVdkTqlJt0HWvBiBIEXFmb4C0DGeYo3Xes9rrEW+TxHsaigCbN5ICQ==", "dev": true, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -1750,12 +1806,12 @@ } }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -1779,21 +1835,6 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", @@ -1827,31 +1868,52 @@ "dev": true }, "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==", "dev": true, "optional": true }, "node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "optional": true, "bin": { "semver": "bin/semver" } }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1944,15 +2006,15 @@ } }, "node_modules/tslib": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", - "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "dev": true }, "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.0.tgz", + "integrity": "sha512-wNKHUY2hYYkf6oSFfhwwiHo4WCHzHmzcXsqXYTN9ja3iApYIFbb2U6ics9hBcYLHcYGQoAlwnZlTrf3oF+BL/Q==", "dev": true, "bin": { "uglifyjs": "bin/uglifyjs" @@ -1984,9 +2046,9 @@ } }, "node_modules/underscore.string/node_modules/sprintf-js": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz", - "integrity": "sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, "node_modules/uri-path": { diff --git a/resources/css/humhub.mail.css b/resources/css/humhub.mail.css index 6b005565..cf26cee8 100644 --- a/resources/css/humhub.mail.css +++ b/resources/css/humhub.mail.css @@ -1,3 +1,17 @@ +:root { + --hh-mail-offset-top: 0px; + --hh-mail-top-conversation-height: 0px; +} +@media (max-width: 991px) { + :root { + --hh-mail-top-conversation-height: 60px; + } +} +@media (max-width: 767px) { + :root { + --hh-mail-top-conversation-height: 50px; + } +} .placeholder { color: #77777A; } @@ -82,9 +96,7 @@ margin: 7px 0 0 11px; } .conversation-entry-list { - max-height: 600px; min-height: 150px; - overflow: auto; } .conversation-entry-list .media { padding-right: 5px; @@ -119,7 +131,15 @@ #mail-conversation-root .ProsemirrorEditor.focusMenu .ProseMirror-menubar { margin-top: 0; } -#mail-conversation-root .panel-body { +#mail-conversation-root > .panel { + display: flex; + flex-direction: column; + height: calc(100vh - var(--hh-fixed-header-height) - var(--hh-fixed-footer-height) - var(--hh-mail-top-conversation-height) - 10px); +} +#mail-conversation-root > .panel > .conversation-entry-container { + flex: 1; + min-height: 300px; + overflow: auto; margin-bottom: 0; } #mail-conversation-header { @@ -187,19 +207,20 @@ color: var(--text-color-secondary); } .mail-message-form { - position: absolute; - bottom: 0; width: 100%; padding: 10px; } +.mail-message-form .content-create-input-group { + position: relative; +} .mail-message-form .humhub-ui-richtext { padding-right: 105px; border-radius: 10px; } .mail-message-form .upload-buttons { position: absolute; - right: 15px; - bottom: 15px; + right: 6px; + bottom: 6px; z-index: 500; } .mail-message-form .reply-button { @@ -256,7 +277,7 @@ text-transform: uppercase; } #inbox { - max-height: 500px; + max-height: calc(100vh - var(--hh-fixed-header-height) - var(--hh-fixed-footer-height) - var('--hh-mail-offset-top')); overflow: auto; border-radius: 4px; } diff --git a/resources/css/humhub.mail.less b/resources/css/humhub.mail.less index e5919574..9c7766bc 100644 --- a/resources/css/humhub.mail.less +++ b/resources/css/humhub.mail.less @@ -10,6 +10,23 @@ @screen-sm: 767px; @screen-md: 991px; +:root { + --hh-mail-offset-top: 0px; + --hh-mail-top-conversation-height: 0px; // Conversation is displayed at the left side of the screen +} + +@media (max-width: @screen-md) { + :root { + --hh-mail-top-conversation-height: 60px; // Including margins + } +} + +@media (max-width: @screen-sm) { + :root { + --hh-mail-top-conversation-height: 50px; // Bottom margin is 10px less on small screens + } +} + .semiBold() { font-weight: 600 } @@ -132,9 +149,7 @@ } .conversation-entry-list { - max-height: 600px; min-height: 150px; - overflow: auto; .media { padding-right: 5px; @@ -181,8 +196,17 @@ } } - .panel-body { - margin-bottom: 0; + > .panel { + display: flex; + flex-direction: column; + height: calc(100vh - var(--hh-fixed-header-height) - var(--hh-fixed-footer-height) - var(--hh-mail-top-conversation-height) - 10px); // 10px is the bottom space + + > .conversation-entry-container { + flex: 1; + min-height: 300px; + overflow: auto; + margin-bottom: 0; + } } } @@ -269,11 +293,13 @@ } .mail-message-form { - position: absolute; - bottom: 0; width: 100%; padding: 10px; + .content-create-input-group { + position: relative; + } + .humhub-ui-richtext { padding-right: 105px; // For the upload and send button border-radius: @radius; @@ -281,8 +307,8 @@ .upload-buttons { position: absolute; - right: 15px; - bottom: 15px; + right: 6px; + bottom: 6px; z-index: 500; } @@ -363,7 +389,7 @@ } #inbox { - max-height: 500px; + max-height: calc(100vh - var(--hh-fixed-header-height) - var(--hh-fixed-footer-height) - var('--hh-mail-offset-top')); overflow: auto; border-radius: @radiusSmall; } diff --git a/resources/css/humhub.mail.min.css b/resources/css/humhub.mail.min.css index ee1905d7..9df5c9bc 100644 --- a/resources/css/humhub.mail.min.css +++ b/resources/css/humhub.mail.min.css @@ -1 +1 @@ -.placeholder{color:#77777a}#dropdown-messages .dropdown-header{color:#000;margin-bottom:12px;font-weight:600}#dropdown-messages.dropdown-menu li a{font-size:inherit!important}#dropdown-messages .media-body{font-weight:200}.modal-body #createmessage-message .ProseMirror{min-height:100px!important}#create-message-button .fa,#mail-conversation-create-button .fa{margin:0}#conversation-filter-link{padding-left:0;display:block;padding-bottom:0}#conversation-tags-root{border-bottom:1px solid #eee}#conversation-tags-root .my-tags-label{padding-right:10px}.conversation-menu{display:none}.conversation-menu .time{color:inherit;text-transform:none}.conversation-menu .badge{background-color:var(--background-color-secondary);border-radius:10px;color:inherit}.conversation-menu .conversation-edit-button{background-color:var(--background-color-secondary);border-radius:50%;color:inherit}.conversation-menu .conversation-edit-button:hover{background-color:var(--background-color-secondary);color:inherit}.visible-xs .conversation-menu{padding-left:35px}.visible-xs .conversation-menu .conversation-menu-item{margin-bottom:10px}.conversation-menu-item{margin-left:5px}.conversation-menu-item a{cursor:pointer}.conversation-edit-button{border-bottom-right-radius:0;border-top-right-radius:0}.conversation-scroll-down-button{position:absolute;bottom:58px;right:25px;width:38px;height:38px;background:#fff;border-radius:50%;box-shadow:1px 1px 2px #999}.conversation-scroll-down-button .fa{font-size:26px;margin:7px 0 0 11px}.conversation-entry-list{max-height:600px;min-height:150px;overflow:auto}.conversation-entry-list .media{padding-right:5px}.conversation-entry-content{display:table;float:left;background-color:var(--background-color-secondary);border-radius:10px;padding:10px;max-width:70%}.conversation-entry-content pre{max-width:485px}.conversation-entry-content.own{float:right;background:var(--background-color-highlight)}.conversation-entry-content .markdown-render{float:left;width:100%;min-width:230px}.conversation-blocked-recipient{-webkit-filter:grayscale(100%);filter:grayscale(100%)}#mail-conversation-root hr{border-top:1px solid #eee}#mail-conversation-root .ProsemirrorEditor.focusMenu .ProseMirror-menubar{margin-top:0}#mail-conversation-root .panel-body{margin-bottom:0}#mail-conversation-header{padding:18px;border-bottom:1px solid var(--background3);border-bottom-left-radius:0;border-bottom-right-radius:0}#mail-conversation-header h1{font-weight:600;font-size:22px;display:inline-block}#mail-conversation-header small{display:block;font-size:11px;font-weight:400}#mail-conversation-header small a{color:var(--text-color-main)}#conversation-settings-button{padding:6px;font-size:12px}#mail-filter-root{margin-top:5px}.mail-inbox-messages .panel-heading>a{font-weight:600}.mail-inbox-messages .panel-heading #mail-filter-root>a{font-weight:400}.mail-inbox-messages .media{margin-top:0;display:flex}.mail-inbox-messages .media h4.media-heading{font-weight:600;font-size:16px}.mail-inbox-messages .media h4.media-heading time{font-size:11px!important;font-weight:400;float:right}.mail-inbox-messages .media h5{font-size:14px;line-height:16px;font-weight:500;color:#000;display:flex;justify-content:space-between;margin:7px 0}.mail-inbox-messages .media h5 span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mail-inbox-messages .media .mail-last-entry{font-size:14px;font-weight:500;color:var(--text-color-secondary)}.mail-message-form{position:absolute;bottom:0;width:100%;padding:10px}.mail-message-form .humhub-ui-richtext{padding-right:105px;border-radius:10px}.mail-message-form .upload-buttons{position:absolute;right:15px;bottom:15px;z-index:500}.mail-message-form .reply-button{margin-left:0!important}.mail-message-form .help-block{margin:0}.mail-message-form .alert{margin-bottom:0}.mail-conversation-entry{margin-top:3px;position:relative}.mail-conversation-entry .author-image .img-user{max-width:100%}.mail-conversation-entry .author-label{font-size:10px;font-weight:600}.mail-conversation-entry.hideUserInfo .author-label{display:none}.mail-conversation-entry.hideUserInfo .author-image a{visibility:hidden;margin-top:0}.mail-conversation-entry.own .conversation-menu-item{float:right;margin-left:0;margin-right:5px}.mail-conversation-entry .conversation-entry-time{float:right;font-size:10px;color:var(--text-color-main)}.mail-conversation-entry .conversation-entry-time>span{font-style:italic}.conversation-entry-badge{padding:10px 0 8px;text-align:center}.conversation-entry-badge span{display:inline-block;box-shadow:1px 1px 3px rgba(0,0,0,.3);border-radius:7px;padding:5px 20px}.conversation-entry-badge.conversation-date-badge span{text-transform:uppercase}#inbox{max-height:500px;overflow:auto;border-radius:4px}.messagePreviewEntry{cursor:pointer}.messagePreviewEntry time{font-size:10px;color:var(--text-color-secondary)}.messagePreviewEntry .new-message-badge{display:none}.messagePreviewEntry.unread .new-message-badge{display:block}.messagePreviewEntry.unread time{color:var(--info)}.messagePreviewEntry.unread .mail-last-entry{color:var(--text-color-highlight)}.message-tag-filter-group .select2-selection{border-bottom-right-radius:0}.message-tag-filter-group .manage-tags-link{font-weight:600;font-size:.8em;border:1px solid #ededed;border-top:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:2px 5px}.new-message-badge{float:right;min-width:14px;height:14px;border-radius:50%;background:var(--info);margin-left:2px}.inbox-entry-title{font-weight:600}.field-replyform-message{margin:0}@media (max-width:991px){#inbox{max-height:500px!important}}@media (max-width:767px){#dropdown-messages{width:300px!important}.arrow{margin-left:-101px!important}#inbox{max-height:none!important}.mail-conversation-single-message #inbox{max-height:none!important}.mail-conversation-single-message .inbox-wrapper{display:none}.conversation-entry-content pre{max-width:245px;padding:0}} \ No newline at end of file +:root{--hh-mail-offset-top:0px;--hh-mail-top-conversation-height:0px}@media (max-width:991px){:root{--hh-mail-top-conversation-height:60px}}@media (max-width:767px){:root{--hh-mail-top-conversation-height:50px}}.placeholder{color:#77777a}#dropdown-messages .dropdown-header{color:#000;margin-bottom:12px;font-weight:600}#dropdown-messages.dropdown-menu li a{font-size:inherit!important}#dropdown-messages .media-body{font-weight:200}.modal-body #createmessage-message .ProseMirror{min-height:100px!important}#create-message-button .fa,#mail-conversation-create-button .fa{margin:0}#conversation-filter-link{padding-left:0;display:block;padding-bottom:0}#conversation-tags-root{border-bottom:1px solid #eee}#conversation-tags-root .my-tags-label{padding-right:10px}.conversation-menu{display:none}.conversation-menu .time{color:inherit;text-transform:none}.conversation-menu .badge{background-color:var(--background-color-secondary);border-radius:10px;color:inherit}.conversation-menu .conversation-edit-button{background-color:var(--background-color-secondary);border-radius:50%;color:inherit}.conversation-menu .conversation-edit-button:hover{background-color:var(--background-color-secondary);color:inherit}.visible-xs .conversation-menu{padding-left:35px}.visible-xs .conversation-menu .conversation-menu-item{margin-bottom:10px}.conversation-menu-item{margin-left:5px}.conversation-menu-item a{cursor:pointer}.conversation-edit-button{border-bottom-right-radius:0;border-top-right-radius:0}.conversation-scroll-down-button{position:absolute;bottom:58px;right:25px;width:38px;height:38px;background:#fff;border-radius:50%;box-shadow:1px 1px 2px #999}.conversation-scroll-down-button .fa{font-size:26px;margin:7px 0 0 11px}.conversation-entry-list{min-height:150px}.conversation-entry-list .media{padding-right:5px}.conversation-entry-content{display:table;float:left;background-color:var(--background-color-secondary);border-radius:10px;padding:10px;max-width:70%}.conversation-entry-content pre{max-width:485px}.conversation-entry-content.own{float:right;background:var(--background-color-highlight)}.conversation-entry-content .markdown-render{float:left;width:100%;min-width:230px}.conversation-blocked-recipient{-webkit-filter:grayscale(100%);filter:grayscale(100%)}#mail-conversation-root hr{border-top:1px solid #eee}#mail-conversation-root .ProsemirrorEditor.focusMenu .ProseMirror-menubar{margin-top:0}#mail-conversation-root>.panel{display:flex;flex-direction:column;height:calc(100vh - var(--hh-fixed-header-height) - var(--hh-fixed-footer-height) - var(--hh-mail-top-conversation-height) - 10px)}#mail-conversation-root>.panel>.conversation-entry-container{flex:1;min-height:300px;overflow:auto;margin-bottom:0}#mail-conversation-header{padding:18px;border-bottom:1px solid var(--background3);border-bottom-left-radius:0;border-bottom-right-radius:0}#mail-conversation-header h1{font-weight:600;font-size:22px;display:inline-block}#mail-conversation-header small{display:block;font-size:11px;font-weight:400}#mail-conversation-header small a{color:var(--text-color-main)}#conversation-settings-button{padding:6px;font-size:12px}#mail-filter-root{margin-top:5px}.mail-inbox-messages .panel-heading>a{font-weight:600}.mail-inbox-messages .panel-heading #mail-filter-root>a{font-weight:400}.mail-inbox-messages .media{margin-top:0;display:flex}.mail-inbox-messages .media h4.media-heading{font-weight:600;font-size:16px}.mail-inbox-messages .media h4.media-heading time{font-size:11px!important;font-weight:400;float:right}.mail-inbox-messages .media h5{font-size:14px;line-height:16px;font-weight:500;color:#000;display:flex;justify-content:space-between;margin:7px 0}.mail-inbox-messages .media h5 span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mail-inbox-messages .media .mail-last-entry{font-size:14px;font-weight:500;color:var(--text-color-secondary)}.mail-message-form{width:100%;padding:10px}.mail-message-form .content-create-input-group{position:relative}.mail-message-form .humhub-ui-richtext{padding-right:105px;border-radius:10px}.mail-message-form .upload-buttons{position:absolute;right:6px;bottom:6px;z-index:500}.mail-message-form .reply-button{margin-left:0!important}.mail-message-form .help-block{margin:0}.mail-message-form .alert{margin-bottom:0}.mail-conversation-entry{margin-top:3px;position:relative}.mail-conversation-entry .author-image .img-user{max-width:100%}.mail-conversation-entry .author-label{font-size:10px;font-weight:600}.mail-conversation-entry.hideUserInfo .author-label{display:none}.mail-conversation-entry.hideUserInfo .author-image a{visibility:hidden;margin-top:0}.mail-conversation-entry.own .conversation-menu-item{float:right;margin-left:0;margin-right:5px}.mail-conversation-entry .conversation-entry-time{float:right;font-size:10px;color:var(--text-color-main)}.mail-conversation-entry .conversation-entry-time>span{font-style:italic}.conversation-entry-badge{padding:10px 0 8px;text-align:center}.conversation-entry-badge span{display:inline-block;box-shadow:1px 1px 3px rgba(0,0,0,.3);border-radius:7px;padding:5px 20px}.conversation-entry-badge.conversation-date-badge span{text-transform:uppercase}#inbox{max-height:calc(100vh - var(--hh-fixed-header-height) - var(--hh-fixed-footer-height) - var('--hh-mail-offset-top'));overflow:auto;border-radius:4px}.messagePreviewEntry{cursor:pointer}.messagePreviewEntry time{font-size:10px;color:var(--text-color-secondary)}.messagePreviewEntry .new-message-badge{display:none}.messagePreviewEntry.unread .new-message-badge{display:block}.messagePreviewEntry.unread time{color:var(--info)}.messagePreviewEntry.unread .mail-last-entry{color:var(--text-color-highlight)}.message-tag-filter-group .select2-selection{border-bottom-right-radius:0}.message-tag-filter-group .manage-tags-link{font-weight:600;font-size:.8em;border:1px solid #ededed;border-top:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:2px 5px}.new-message-badge{float:right;min-width:14px;height:14px;border-radius:50%;background:var(--info);margin-left:2px}.inbox-entry-title{font-weight:600}.field-replyform-message{margin:0}@media (max-width:991px){#inbox{max-height:500px!important}}@media (max-width:767px){#dropdown-messages{width:300px!important}.arrow{margin-left:-101px!important}#inbox{max-height:none!important}.mail-conversation-single-message #inbox{max-height:none!important}.mail-conversation-single-message .inbox-wrapper{display:none}.conversation-entry-content pre{max-width:245px;padding:0}} \ No newline at end of file diff --git a/resources/js/humhub.mail.ConversationView.js b/resources/js/humhub.mail.ConversationView.js index 94bbc54d..5c6df76a 100644 --- a/resources/js/humhub.mail.ConversationView.js +++ b/resources/js/humhub.mail.ConversationView.js @@ -13,11 +13,6 @@ humhub.module('mail.ConversationView', function (module, require, $) { ConversationView.prototype.init = function () { additions.observe(this.$); - var that = this; - window.onresize = function (evt) { - that.updateSize(true); - }; - if (!this.getActiveMessageId()) { this.setActiveMessageId(Widget.instance('#inbox').getFirstMessageId()); } @@ -206,25 +201,7 @@ humhub.module('mail.ConversationView', function (module, require, $) { ConversationView.prototype.initReplyRichText = function () { var that = this; - - if (window.ResizeObserver) { - var resizeObserver = new ResizeObserver(function (entries) { - that.updateSize(that.isScrolledToBottom(100)); - }); - - var replyRichtext = that.getReplyRichtext(); - if (replyRichtext) { - resizeObserver.observe(replyRichtext.$[0]); - } - } - - var filePreview = that.getReplyFilePreview(); - filePreview.on('DOMSubtreeModified', function (evt) { - that.updateSize(true); - }); - that.focus(); - }; ConversationView.prototype.isScrolledToBottom = function (tolerance) { @@ -346,7 +323,6 @@ humhub.module('mail.ConversationView', function (module, require, $) { }); }; - ConversationView.prototype.getActiveMessageId = function () { return this.options.messageId; }; @@ -366,43 +342,13 @@ humhub.module('mail.ConversationView', function (module, require, $) { return; } - that.updateSize(false).then(function () { - $list[0].scrollTop = $list[0].scrollHeight; - resolve() - }); + $list[0].scrollTop = $list[0].scrollHeight; + resolve() }) }); }); }; - ConversationView.prototype.updateSize = function (scrollToButtom) { - var that = this; - return new Promise(function (resolve) { - setTimeout(function () { - var $entryContainer = that.getListNode(); - - if (!$entryContainer.length) { - return; - } - - var replyRichtext = that.getReplyRichtext(); - var formHeight = replyRichtext ? replyRichtext.$.closest('.mail-message-form').innerHeight() : 0; - $entryContainer.css('margin-bottom', formHeight + 5 + 'px'); - - var offsetTop = that.getListNode().offset().top; - var max_height = (window.innerHeight - offsetTop - formHeight - (view.isSmall() ? 20 : 30)) + 'px'; - $entryContainer.css('height', max_height); - $entryContainer.css('max-height', max_height); - - if (scrollToButtom !== false) { - that.scrollToBottom(); - } - resolve(); - }, 100); - }) - - }; - ConversationView.prototype.getListNode = function () { return this.$.find('.conversation-entry-list'); }; diff --git a/resources/js/humhub.mail.inbox.js b/resources/js/humhub.mail.inbox.js index 546c30dc..6807a206 100644 --- a/resources/js/humhub.mail.inbox.js +++ b/resources/js/humhub.mail.inbox.js @@ -7,7 +7,7 @@ humhub.module('mail.inbox', function (module, require, $) { var ConversationFilter = Filter.extend(); - ConversationFilter.prototype.triggerChange = function() { + ConversationFilter.prototype.triggerChange = function () { this.super('triggerChange'); this.updateFilterCount(); }; @@ -18,12 +18,12 @@ humhub.module('mail.inbox', function (module, require, $) { var $filterToggle = this.$.find('#conversation-filter-link'); var $filterCount = $filterToggle.find('.filterCount'); - if(count) { - if(!$filterCount.length) { + if (count) { + if (!$filterCount.length) { $filterCount = $('').insertBefore($filterToggle.find('.caret')); } - $filterCount.html(' ('+count+') '); - } else if($filterCount.length) { + $filterCount.html(' (' + count + ') '); + } else if ($filterCount.length) { $filterCount.remove(); } }; @@ -38,12 +38,12 @@ humhub.module('mail.inbox', function (module, require, $) { var that = this; this.filter.off('afterChange.inbox').on('afterChange.inbox', function () { - that.reload().then(function() { + that.reload().then(function () { that.updateActiveItem(); }); }); - if(view.isLarge()) { + if (view.isLarge()) { this.$.niceScroll({ cursorwidth: "7", cursorborder: "", @@ -54,49 +54,49 @@ humhub.module('mail.inbox', function (module, require, $) { }); } - this.$.on('click', '.entry', function() { + this.$.on('click', '.entry', function () { that.$.find('.entry').removeClass('selected'); $(this).addClass('selected'); }) }; - ConversationList.prototype.initHeight = function() { + ConversationList.prototype.initHeight = function () { const offsetTop = this.$.offset().top; - this.$.css('max-height', (window.innerHeight - offsetTop - 15) + 'px'); + $(':root').css('--hh-mail-offset-top', offsetTop + 'px'); } - ConversationList.prototype.updateEntries = function(ids) { + ConversationList.prototype.updateEntries = function (ids) { var that = this; - if(!ids.length) { + if (!ids.length) { return; } - client.get(this.options.updateEntriesUrl, {data: {ids: ids}}).then(function(response) { - if(!response.result) { + client.get(this.options.updateEntriesUrl, {data: {ids: ids}}).then(function (response) { + if (!response.result) { return; } - $.each(response.result, function(id, html) { + $.each(response.result, function (id, html) { var $entry = that.getEntry(id); - if(!$entry.length) { - $(html).prependTo(that.$) ; + if (!$entry.length) { + $(html).prependTo(that.$); } else { - $entry.replaceWith(html); + $entry.replaceWith(html); } }); that.updateActiveItem(); - }).catch(function(e) { + }).catch(function (e) { module.log.error(e); }); }; - ConversationList.prototype.getEntry = function(id) { - return this.$.find('[data-message-id="'+id+'"]'); + ConversationList.prototype.getEntry = function (id) { + return this.$.find('[data-message-id="' + id + '"]'); }; - ConversationList.prototype.initScroll = function() { + ConversationList.prototype.initScroll = function () { if (window.IntersectionObserver) { var $streamEnd = $('
'); @@ -110,7 +110,7 @@ humhub.module('mail.inbox', function (module, require, $) { if (entries.length && entries[0].isIntersecting) { loader.append(that.$); - that.loadMore().finally(function() { + that.loadMore().finally(function () { loader.reset(that.$); }); } @@ -118,7 +118,7 @@ humhub.module('mail.inbox', function (module, require, $) { }, {root: this.$[0], rootMargin: "50px"}); // Assure the conversation list is scrollable by loading more entries until overflow - this.assureScroll().then(function() { + this.assureScroll().then(function () { observer.observe($streamEnd[0]); }); } @@ -127,8 +127,8 @@ humhub.module('mail.inbox', function (module, require, $) { ConversationList.prototype.assureScroll = function () { var that = this; - if(this.$[0].offsetHeight >= this.$[0].scrollHeight && this.canLoadMore()) { - return this.loadMore().then(function() { + if (this.$[0].offsetHeight >= this.$[0].scrollHeight && this.canLoadMore()) { + return this.loadMore().then(function () { return that.assureScroll(); }).catch(function () { return Promise.resolve(); @@ -140,11 +140,11 @@ humhub.module('mail.inbox', function (module, require, $) { ConversationList.prototype.loadMore = function () { var that = this; - return new Promise(function(resolve, reject) { + return new Promise(function (resolve, reject) { var data = that.filter.getFilterMap(); data.from = that.getLastMessageId(); - client.get(that.options.loadMoreUrl, {data: data}).then(function(response) { - if(response.result) { + client.get(that.options.loadMoreUrl, {data: data}).then(function (response) { + if (response.result) { $(response.result).insertBefore('.inbox-stream-end'); that.$.find('.inbox-stream-end').append(); } @@ -153,10 +153,10 @@ humhub.module('mail.inbox', function (module, require, $) { that.updateActiveItem(); resolve(); - }).catch(function(err) { + }).catch(function (err) { module.log.error(err, true); reject(); - }).finally(function() { + }).finally(function () { that.scrollLock = false; }); }); @@ -175,7 +175,7 @@ humhub.module('mail.inbox', function (module, require, $) { return {data: this.filter.getFilterMap()}; }; - ConversationList.prototype.updateActiveItem = function() { + ConversationList.prototype.updateActiveItem = function () { this.$.find('.entry').removeClass('selected'); // Set new selection @@ -188,21 +188,18 @@ humhub.module('mail.inbox', function (module, require, $) { }; - ConversationList.prototype.getFirstMessageId = function() { + ConversationList.prototype.getFirstMessageId = function () { return this.$.find('.entry:first').data('message-id'); }; - ConversationList.prototype.getLastMessageId = function() { + ConversationList.prototype.getLastMessageId = function () { return this.$.find('.entry:last').data('message-id'); }; - ConversationList.prototype.hide = function() { + ConversationList.prototype.hide = function () { return new Promise(function (resolve) { - if(view.isSmall() && $('.mail-conversation-single-message').length) { - $('.inbox-wrapper').slideUp(function() { - if (getRoot()) { - getRoot().updateSize(); - } + if (view.isSmall() && $('.mail-conversation-single-message').length) { + $('.inbox-wrapper').slideUp(function () { resolve(); }); } @@ -210,14 +207,10 @@ humhub.module('mail.inbox', function (module, require, $) { }); }; - ConversationList.prototype.show = function() { + ConversationList.prototype.show = function () { return new Promise(function (resolve) { - if(view.isSmall()) { - $('.inbox-wrapper').slideDown(function() { - if (getRoot()) { - getRoot().updateSize(); - } - + if (view.isSmall()) { + $('.inbox-wrapper').slideDown(function () { resolve(); }); } @@ -225,18 +218,14 @@ humhub.module('mail.inbox', function (module, require, $) { }); }; - var toggleInbox = function() { - if(view.isSmall()) { - $('.inbox-wrapper').slideToggle(function() { - if (getRoot()) { - getRoot().updateSize(); - } - }); + var toggleInbox = function () { + if (view.isSmall()) { + $('.inbox-wrapper').slideToggle(); } }; var setTagFilter = function (evt) { - Widget.instance('#inbox').show().then(function() { + Widget.instance('#inbox').show().then(function () { $('#mail-filter-menu').collapse('show'); Widget.instance('#inbox-tag-picker').setSelection([{ id: evt.$trigger.data('tagId'), diff --git a/resources/js/humhub.mail.messenger.bundle.js b/resources/js/humhub.mail.messenger.bundle.js index 8a3d60bf..ff168315 100644 --- a/resources/js/humhub.mail.messenger.bundle.js +++ b/resources/js/humhub.mail.messenger.bundle.js @@ -13,11 +13,6 @@ humhub.module('mail.ConversationView', function (module, require, $) { ConversationView.prototype.init = function () { additions.observe(this.$); - var that = this; - window.onresize = function (evt) { - that.updateSize(true); - }; - if (!this.getActiveMessageId()) { this.setActiveMessageId(Widget.instance('#inbox').getFirstMessageId()); } @@ -206,25 +201,7 @@ humhub.module('mail.ConversationView', function (module, require, $) { ConversationView.prototype.initReplyRichText = function () { var that = this; - - if (window.ResizeObserver) { - var resizeObserver = new ResizeObserver(function (entries) { - that.updateSize(that.isScrolledToBottom(100)); - }); - - var replyRichtext = that.getReplyRichtext(); - if (replyRichtext) { - resizeObserver.observe(replyRichtext.$[0]); - } - } - - var filePreview = that.getReplyFilePreview(); - filePreview.on('DOMSubtreeModified', function (evt) { - that.updateSize(true); - }); - that.focus(); - }; ConversationView.prototype.isScrolledToBottom = function (tolerance) { @@ -346,7 +323,6 @@ humhub.module('mail.ConversationView', function (module, require, $) { }); }; - ConversationView.prototype.getActiveMessageId = function () { return this.options.messageId; }; @@ -366,43 +342,13 @@ humhub.module('mail.ConversationView', function (module, require, $) { return; } - that.updateSize(false).then(function () { - $list[0].scrollTop = $list[0].scrollHeight; - resolve() - }); + $list[0].scrollTop = $list[0].scrollHeight; + resolve() }) }); }); }; - ConversationView.prototype.updateSize = function (scrollToButtom) { - var that = this; - return new Promise(function (resolve) { - setTimeout(function () { - var $entryContainer = that.getListNode(); - - if (!$entryContainer.length) { - return; - } - - var replyRichtext = that.getReplyRichtext(); - var formHeight = replyRichtext ? replyRichtext.$.closest('.mail-message-form').innerHeight() : 0; - $entryContainer.css('margin-bottom', formHeight + 5 + 'px'); - - var offsetTop = that.getListNode().offset().top; - var max_height = (window.innerHeight - offsetTop - formHeight - (view.isSmall() ? 20 : 30)) + 'px'; - $entryContainer.css('height', max_height); - $entryContainer.css('max-height', max_height); - - if (scrollToButtom !== false) { - that.scrollToBottom(); - } - resolve(); - }, 100); - }) - - }; - ConversationView.prototype.getListNode = function () { return this.$.find('.conversation-entry-list'); }; @@ -415,7 +361,7 @@ humhub.module('mail.ConversationView', function (module, require, $) { module.export = ConversationView; }); - + humhub.module('mail.ConversationEntry', function (module, require, $) { var Widget = require('ui.widget').Widget; @@ -439,7 +385,7 @@ humhub.module('mail.ConversationEntry', function (module, require, $) { }; module.export = ConversationEntry; -}); +}); humhub.module('mail.inbox', function (module, require, $) { var Widget = require('ui.widget').Widget; var Filter = require('ui.filter').Filter; @@ -449,7 +395,7 @@ humhub.module('mail.inbox', function (module, require, $) { var ConversationFilter = Filter.extend(); - ConversationFilter.prototype.triggerChange = function() { + ConversationFilter.prototype.triggerChange = function () { this.super('triggerChange'); this.updateFilterCount(); }; @@ -460,12 +406,12 @@ humhub.module('mail.inbox', function (module, require, $) { var $filterToggle = this.$.find('#conversation-filter-link'); var $filterCount = $filterToggle.find('.filterCount'); - if(count) { - if(!$filterCount.length) { + if (count) { + if (!$filterCount.length) { $filterCount = $('').insertBefore($filterToggle.find('.caret')); } - $filterCount.html(' ('+count+') '); - } else if($filterCount.length) { + $filterCount.html(' (' + count + ') '); + } else if ($filterCount.length) { $filterCount.remove(); } }; @@ -480,12 +426,12 @@ humhub.module('mail.inbox', function (module, require, $) { var that = this; this.filter.off('afterChange.inbox').on('afterChange.inbox', function () { - that.reload().then(function() { + that.reload().then(function () { that.updateActiveItem(); }); }); - if(view.isLarge()) { + if (view.isLarge()) { this.$.niceScroll({ cursorwidth: "7", cursorborder: "", @@ -496,49 +442,49 @@ humhub.module('mail.inbox', function (module, require, $) { }); } - this.$.on('click', '.entry', function() { + this.$.on('click', '.entry', function () { that.$.find('.entry').removeClass('selected'); $(this).addClass('selected'); }) }; - ConversationList.prototype.initHeight = function() { + ConversationList.prototype.initHeight = function () { const offsetTop = this.$.offset().top; - this.$.css('max-height', (window.innerHeight - offsetTop - 15) + 'px'); + $(':root').css('--hh-mail-offset-top', offsetTop + 'px'); } - ConversationList.prototype.updateEntries = function(ids) { + ConversationList.prototype.updateEntries = function (ids) { var that = this; - if(!ids.length) { + if (!ids.length) { return; } - client.get(this.options.updateEntriesUrl, {data: {ids: ids}}).then(function(response) { - if(!response.result) { + client.get(this.options.updateEntriesUrl, {data: {ids: ids}}).then(function (response) { + if (!response.result) { return; } - $.each(response.result, function(id, html) { + $.each(response.result, function (id, html) { var $entry = that.getEntry(id); - if(!$entry.length) { - $(html).prependTo(that.$) ; + if (!$entry.length) { + $(html).prependTo(that.$); } else { - $entry.replaceWith(html); + $entry.replaceWith(html); } }); that.updateActiveItem(); - }).catch(function(e) { + }).catch(function (e) { module.log.error(e); }); }; - ConversationList.prototype.getEntry = function(id) { - return this.$.find('[data-message-id="'+id+'"]'); + ConversationList.prototype.getEntry = function (id) { + return this.$.find('[data-message-id="' + id + '"]'); }; - ConversationList.prototype.initScroll = function() { + ConversationList.prototype.initScroll = function () { if (window.IntersectionObserver) { var $streamEnd = $('
'); @@ -552,7 +498,7 @@ humhub.module('mail.inbox', function (module, require, $) { if (entries.length && entries[0].isIntersecting) { loader.append(that.$); - that.loadMore().finally(function() { + that.loadMore().finally(function () { loader.reset(that.$); }); } @@ -560,7 +506,7 @@ humhub.module('mail.inbox', function (module, require, $) { }, {root: this.$[0], rootMargin: "50px"}); // Assure the conversation list is scrollable by loading more entries until overflow - this.assureScroll().then(function() { + this.assureScroll().then(function () { observer.observe($streamEnd[0]); }); } @@ -569,8 +515,8 @@ humhub.module('mail.inbox', function (module, require, $) { ConversationList.prototype.assureScroll = function () { var that = this; - if(this.$[0].offsetHeight >= this.$[0].scrollHeight && this.canLoadMore()) { - return this.loadMore().then(function() { + if (this.$[0].offsetHeight >= this.$[0].scrollHeight && this.canLoadMore()) { + return this.loadMore().then(function () { return that.assureScroll(); }).catch(function () { return Promise.resolve(); @@ -582,11 +528,11 @@ humhub.module('mail.inbox', function (module, require, $) { ConversationList.prototype.loadMore = function () { var that = this; - return new Promise(function(resolve, reject) { + return new Promise(function (resolve, reject) { var data = that.filter.getFilterMap(); data.from = that.getLastMessageId(); - client.get(that.options.loadMoreUrl, {data: data}).then(function(response) { - if(response.result) { + client.get(that.options.loadMoreUrl, {data: data}).then(function (response) { + if (response.result) { $(response.result).insertBefore('.inbox-stream-end'); that.$.find('.inbox-stream-end').append(); } @@ -595,10 +541,10 @@ humhub.module('mail.inbox', function (module, require, $) { that.updateActiveItem(); resolve(); - }).catch(function(err) { + }).catch(function (err) { module.log.error(err, true); reject(); - }).finally(function() { + }).finally(function () { that.scrollLock = false; }); }); @@ -617,7 +563,7 @@ humhub.module('mail.inbox', function (module, require, $) { return {data: this.filter.getFilterMap()}; }; - ConversationList.prototype.updateActiveItem = function() { + ConversationList.prototype.updateActiveItem = function () { this.$.find('.entry').removeClass('selected'); // Set new selection @@ -630,21 +576,18 @@ humhub.module('mail.inbox', function (module, require, $) { }; - ConversationList.prototype.getFirstMessageId = function() { + ConversationList.prototype.getFirstMessageId = function () { return this.$.find('.entry:first').data('message-id'); }; - ConversationList.prototype.getLastMessageId = function() { + ConversationList.prototype.getLastMessageId = function () { return this.$.find('.entry:last').data('message-id'); }; - ConversationList.prototype.hide = function() { + ConversationList.prototype.hide = function () { return new Promise(function (resolve) { - if(view.isSmall() && $('.mail-conversation-single-message').length) { - $('.inbox-wrapper').slideUp(function() { - if (getRoot()) { - getRoot().updateSize(); - } + if (view.isSmall() && $('.mail-conversation-single-message').length) { + $('.inbox-wrapper').slideUp(function () { resolve(); }); } @@ -652,14 +595,10 @@ humhub.module('mail.inbox', function (module, require, $) { }); }; - ConversationList.prototype.show = function() { + ConversationList.prototype.show = function () { return new Promise(function (resolve) { - if(view.isSmall()) { - $('.inbox-wrapper').slideDown(function() { - if (getRoot()) { - getRoot().updateSize(); - } - + if (view.isSmall()) { + $('.inbox-wrapper').slideDown(function () { resolve(); }); } @@ -667,18 +606,14 @@ humhub.module('mail.inbox', function (module, require, $) { }); }; - var toggleInbox = function() { - if(view.isSmall()) { - $('.inbox-wrapper').slideToggle(function() { - if (getRoot()) { - getRoot().updateSize(); - } - }); + var toggleInbox = function () { + if (view.isSmall()) { + $('.inbox-wrapper').slideToggle(); } }; var setTagFilter = function (evt) { - Widget.instance('#inbox').show().then(function() { + Widget.instance('#inbox').show().then(function () { $('#mail-filter-menu').collapse('show'); Widget.instance('#inbox-tag-picker').setSelection([{ id: evt.$trigger.data('tagId'), @@ -703,7 +638,7 @@ humhub.module('mail.inbox', function (module, require, $) { toggleInbox: toggleInbox }); }); - + humhub.module('mail.conversation', function (module, require, $) { var Widget = require('ui.widget').Widget; var modal = require('ui.modal'); diff --git a/resources/js/humhub.mail.messenger.bundle.min.js b/resources/js/humhub.mail.messenger.bundle.min.js index cfc40c54..a993a9cb 100644 --- a/resources/js/humhub.mail.messenger.bundle.min.js +++ b/resources/js/humhub.mail.messenger.bundle.min.js @@ -1 +1 @@ -humhub.module("mail.ConversationView",function(r,t,n){var s=t("ui.widget").Widget,a=t("ui.loader"),c=t("client"),o=t("ui.additions"),e=t("util.object"),i=t("mail.notification"),l=t("ui.view"),u=s.extend();u.prototype.init=function(){o.observe(this.$);var e=this;window.onresize=function(t){e.updateSize(!0)},this.getActiveMessageId()||this.setActiveMessageId(s.instance("#inbox").getFirstMessageId()),this.reload(),this.$.on("mouseenter",".mail-conversation-entry",function(){n(this).find(".conversation-menu").show()}).on("mouseleave",".mail-conversation-entry",function(){n(this).find(".conversation-menu").hide()})},u.prototype.loader=function(t){!1!==t?a.set(this.$):a.reset(this.$)},u.prototype.markSeen=function(t){c.post(this.options.markSeenUrl,{data:{id:t}}).then(function(t){e.isDefined(t.messageCount)&&i.setMailMessageCount(t.messageCount)}).catch(function(t){r.log.error(t)})},u.prototype.loadUpdate=function(){var t=this.$.find(".mail-conversation-entry:not(.own):last").data("entry-id"),t={id:this.getActiveMessageId(),from:t},e=this;c.get(this.options.loadUpdateUrl,{data:t}).then(function(t){t.html&&n(t.html).each(function(){e.appendEntry(n(this))})})},u.prototype.reply=function(e){var o=this;c.submit(e).then(function(t){t.success?o.appendEntry(t.content).then(function(){o.$.find(".time").timeago();var t=o.getReplyRichtext(),t=(t&&t.$.trigger("clear"),o.getReplyFilePreview());t.length&&(t.hide(),t.children("ul.files").html("")),o.scrollToBottom(),l.isSmall()||o.focus(),s.instance("#inbox").updateEntries([o.getActiveMessageId()]),o.setLivePollInterval()}):r.log.error(t,!0)}).catch(function(t){r.log.error(t,!0)}).finally(function(t){a.reset(n(".reply-button")),e.finish()})},u.prototype.setLivePollInterval=function(){t("live").setDelay(5)},u.prototype.getReplyRichtext=function(){return s.instance(this.$.find(".ProsemirrorEditor"))},u.prototype.getReplyFilePreview=function(){return this.$.find(".post-file-list")},u.prototype.focus=function(t){var e=this.getReplyRichtext();e&&e.focus()},u.prototype.canLoadMore=function(){return!this.options.isLast},u.prototype.reload=function(){this.getActiveMessageId()&&this.loadMessage(this.getActiveMessageId())},u.prototype.addUser=function(t){var e=this;c.submit(t).then(function(t){t.result?e.$.find("#mail-conversation-header").html(t.result):t.error&&r.log.error(t,!0)}).catch(function(t){r.log.error(t,!0)})},u.prototype.appendEntry=function(t){var o,i=this,t=n(t);return i.$.find('[data-entry-id="'+t.data("entryId")+'"]').length?Promise.resolve():((o=t.not("script, link").filter(function(){return 1===this.nodeType})).css("opacity",0),this.getListNode().append(t),new Promise(function(t,e){o.css("opacity",1).fadeIn("fast",function(){i.onUpdate(),setTimeout(function(){i.scrollToBottom()},100),t()})}))},u.prototype.loadMessage=function(o){var i=e.isNumber(o)?o:o.$trigger.data("message-id"),n=this;this.loader(),c.get(this.options.loadMessageUrl,{data:{id:i}}).then(function(t){n.setActiveMessageId(i),n.options.isLast=!1;var e=s.instance("#inbox");return e.updateActiveItem(),e.hide(),o.$trigger&&history&&history.replaceState&&(e=o.$trigger.data("action-url"))&&history.replaceState(null,null,e),n.$.css("visibility","hidden"),n.updateContent(t.html)}).then(function(){return n.initScroll()}).catch(function(t){r.log.error(t,!0)}).finally(function(){n.loader(!1),n.$.css("visibility","visible"),n.initReplyRichText()})},u.prototype.initReplyRichText=function(){var t,e,o=this;window.ResizeObserver&&(t=new ResizeObserver(function(t){o.updateSize(o.isScrolledToBottom(100))}),e=o.getReplyRichtext())&&t.observe(e.$[0]),o.getReplyFilePreview().on("DOMSubtreeModified",function(t){o.updateSize(!0)}),o.focus()},u.prototype.isScrolledToBottom=function(t){if(!this.getListNode().length)return!1;t=t||0;var e=this.getListNode()[0];return e.scrollHeight-e.offsetHeight-e.scrollTop<=t},u.prototype.initScroll=function(){var e,t,o,i;if(window.IntersectionObserver)return e=this.getListNode(),t=n('
'),e.prepend(t),o=this,i=new IntersectionObserver(function(t){o.preventScrollLoading()||t.length&&t[0].isIntersecting&&(a.prepend(e),o.loadMore().finally(function(){a.reset(e)}))},{root:e[0],rootMargin:"50px"}),this.assureScroll().then(function(){i.observe(t[0]),l.isLarge()&&(o.getListNode().niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:0,left:0,bottom:0}}),o.scrollDownButton=void 0,o.getListNode().on("scroll",()=>o.getScrollDownButton().toggle(!o.isScrolledToBottom())))})},u.prototype.getScrollDownButton=function(){return"object"!=typeof this.scrollDownButton&&(this.scrollDownButton=n("
").addClass("conversation-scroll-down-button").html('').on("click",()=>this.scrollToBottom()),this.getListNode().append(this.scrollDownButton)),this.scrollDownButton},u.prototype.loadMore=function(){var o=this,t={id:this.getActiveMessageId(),from:this.$.find(".mail-conversation-entry:first").data("entryId")};return c.get(this.options.loadMoreUrl,{data:t}).then(function(t){var e;t.result&&(e=n(t.result).hide(),o.getListNode().find(".conversation-stream-end").after(e),e.fadeIn()),o.options.isLast=!t.result||t.isLast}).catch(function(t){r.log.error(t,!0)})},u.prototype.preventScrollLoading=function(){return this.scrollLock||!this.canLoadMore()},u.prototype.canLoadMore=function(){return!this.options.isLast},u.prototype.assureScroll=function(){var t=this,e=this.getListNode();return e[0].offsetHeight>=e[0].scrollHeight&&this.canLoadMore()?this.loadMore().then(function(){return t.assureScroll()}).catch(function(){return Promise.resolve()}):t.scrollToBottom()},u.prototype.updateContent=function(e){var o=this;return new Promise(function(t){o.$.html(e),t()})},u.prototype.getActiveMessageId=function(){return this.options.messageId},u.prototype.setActiveMessageId=function(t){this.options.messageId=t},u.prototype.scrollToBottom=function(){var o=this;return new Promise(function(e){setTimeout(function(){o.$.imagesLoaded(function(){var t=o.getListNode();t.length&&o.updateSize(!1).then(function(){t[0].scrollTop=t[0].scrollHeight,e()})})})})},u.prototype.updateSize=function(n){var r=this;return new Promise(function(i){setTimeout(function(){var t,e,o=r.getListNode();o.length&&(t=(t=r.getReplyRichtext())?t.$.closest(".mail-message-form").innerHeight():0,o.css("margin-bottom",t+5+"px"),e=r.getListNode().offset().top,e=window.innerHeight-e-t-(l.isSmall()?20:30)+"px",o.css("height",e),o.css("max-height",e),!1!==n&&r.scrollToBottom(),i())},100)})},u.prototype.getListNode=function(){return this.$.find(".conversation-entry-list")},u.prototype.onUpdate=function(){l.isLarge()&&this.getListNode().getNiceScroll().resize()},r.export=u}),humhub.module("mail.ConversationEntry",function(t,e,i){e=e("ui.widget").Widget.extend();e.prototype.replace=function(t){var e=this,o=i(t).hide();this.$.fadeOut(function(){i(this).replaceWith(o),e.$=o,e.$.fadeIn("slow")})},e.prototype.remove=function(){this.$.fadeToggle("slow",function(){i(this).remove()})},t.export=e}),humhub.module("mail.inbox",function(n,t,r){var e=t("ui.widget").Widget,o=t("ui.filter").Filter,i=t("ui.view"),s=t("ui.loader"),a=t("client"),t=o.extend(),o=(t.prototype.triggerChange=function(){this.super("triggerChange"),this.updateFilterCount()},t.prototype.updateFilterCount=function(){var t=this.getActiveFilterCount(),e=this.$.find("#conversation-filter-link"),o=e.find(".filterCount");t?(o=o.length?o:r('').insertBefore(e.find(".caret"))).html(" ("+t+") "):o.length&&o.remove()},e.extend()),c=(o.prototype.init=function(){this.filter=e.instance("#mail-filter-root"),this.initScroll(),this.initHeight();var t=this;this.filter.off("afterChange.inbox").on("afterChange.inbox",function(){t.reload().then(function(){t.updateActiveItem()})}),i.isLarge()&&this.$.niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:3,left:0,bottom:0}}),this.$.on("click",".entry",function(){t.$.find(".entry").removeClass("selected"),r(this).addClass("selected")})},o.prototype.initHeight=function(){var t=this.$.offset().top;this.$.css("max-height",window.innerHeight-t-15+"px")},o.prototype.updateEntries=function(t){var o=this;t.length&&a.get(this.options.updateEntriesUrl,{data:{ids:t}}).then(function(t){t.result&&(r.each(t.result,function(t,e){t=o.getEntry(t);t.length?t.replaceWith(e):r(e).prependTo(o.$)}),o.updateActiveItem())}).catch(function(t){n.log.error(t)})},o.prototype.getEntry=function(t){return this.$.find('[data-message-id="'+t+'"]')},o.prototype.initScroll=function(){var t,e,o;window.IntersectionObserver&&(t=r('
'),this.$.append(t),e=this,o=new IntersectionObserver(function(t){e.preventScrollLoading()||t.length&&t[0].isIntersecting&&(s.append(e.$),e.loadMore().finally(function(){s.reset(e.$)}))},{root:this.$[0],rootMargin:"50px"}),this.assureScroll().then(function(){o.observe(t[0])}))},o.prototype.assureScroll=function(){var t=this;return this.$[0].offsetHeight>=this.$[0].scrollHeight&&this.canLoadMore()?this.loadMore().then(function(){return t.assureScroll()}).catch(function(){return Promise.resolve()}):Promise.resolve()},o.prototype.loadMore=function(){var i=this;return new Promise(function(e,o){var t=i.filter.getFilterMap();t.from=i.getLastMessageId(),a.get(i.options.loadMoreUrl,{data:t}).then(function(t){t.result&&(r(t.result).insertBefore(".inbox-stream-end"),i.$.find(".inbox-stream-end").append()),i.options.isLast=!t.result||t.isLast,i.updateActiveItem(),e()}).catch(function(t){n.log.error(t,!0),o()}).finally(function(){i.scrollLock=!1})})},o.prototype.preventScrollLoading=function(){return this.scrollLock||!this.canLoadMore()},o.prototype.canLoadMore=function(){return!this.options.isLast},o.prototype.getReloadOptions=function(){return{data:this.filter.getFilterMap()}},o.prototype.updateActiveItem=function(){var t;this.$.find(".entry").removeClass("selected"),l()&&(t=this.$.find('[data-message-id="'+l().getActiveMessageId()+'"]')).length&&t.removeClass("unread").addClass("selected")},o.prototype.getFirstMessageId=function(){return this.$.find(".entry:first").data("message-id")},o.prototype.getLastMessageId=function(){return this.$.find(".entry:last").data("message-id")},o.prototype.hide=function(){return new Promise(function(t){i.isSmall()&&r(".mail-conversation-single-message").length&&r(".inbox-wrapper").slideUp(function(){l()&&l().updateSize(),t()}),t()})},o.prototype.show=function(){return new Promise(function(t){i.isSmall()&&r(".inbox-wrapper").slideDown(function(){l()&&l().updateSize(),t()}),t()})},null),l=function(){return c=c||e.instance("#mail-conversation-root")};n.export({ConversationList:o,Filter:t,setTagFilter:function(t){e.instance("#inbox").show().then(function(){r("#mail-filter-menu").collapse("show"),e.instance("#inbox-tag-picker").setSelection([{id:t.$trigger.data("tagId"),text:t.$trigger.data("tagName"),image:t.$trigger.data("tagImage")}])})},toggleInbox:function(){i.isSmall()&&r(".inbox-wrapper").slideToggle(function(){l()&&l().updateSize()})}})}),humhub.module("mail.conversation",function(i,t,r){function n(t){return s.instance('.mail-conversation-entry[data-entry-id="'+t+'"]')}var s=t("ui.widget").Widget,a=t("ui.modal"),o=t("client"),e=t("event"),c=t("mail.notification");i.export({init:function(){e.on("humhub:modules:mail:live:NewUserMessage",function(t,e){var o,i,n;r("#inbox").length&&(o=s.instance("#mail-conversation-root"),i=!1,n=[],e.forEach(function(t){n.push(t.data.message_id),!i&&o&&o.options.messageId==t.data.message_id&&(o.loadUpdate(),i=!0,o.markSeen(t.data.message_id))}),s.instance("#inbox").updateEntries(n))}).on("humhub:modules:mail:live:UserMessageDeleted",function(t,e,o){r("#inbox").length&&e.forEach(function(t){var e=n(t.data.entry_id);e&&e.remove(),c.setMailMessageCount(t.data.count)})})},linkAction:function(t){o.post(t).then(function(t){t.redirect&&o.pjax.redirect(t.redirect)}).catch(function(t){i.log.error(t,!0)})},submitEditEntry:function(o){a.submit(o).then(function(t){var e;t.success?(e=n(o.$trigger.data("entry-id")))&&setTimeout(function(){e.replace(t.content)},300):i.log.error(null,!0)}).catch(function(t){i.log.error(t,!0)})},deleteEntry:function(t){var e=n(t.$trigger.data("entry-id"));e?o.post(e.options.deleteUrl).then(function(t){a.global.close(),t.success&&setTimeout(function(){e.remove()},1e3)}).catch(function(t){i.log.error(t,!0)}):i.log.error(null,!0)}})}); \ No newline at end of file +humhub.module("mail.ConversationView",function(r,t,i){var s=t("ui.widget").Widget,a=t("ui.loader"),l=t("client"),e=t("ui.additions"),c=t("util.object"),o=t("mail.notification"),u=t("ui.view"),n=s.extend();n.prototype.init=function(){e.observe(this.$),this.getActiveMessageId()||this.setActiveMessageId(s.instance("#inbox").getFirstMessageId()),this.reload(),this.$.on("mouseenter",".mail-conversation-entry",function(){i(this).find(".conversation-menu").show()}).on("mouseleave",".mail-conversation-entry",function(){i(this).find(".conversation-menu").hide()})},n.prototype.loader=function(t){!1!==t?a.set(this.$):a.reset(this.$)},n.prototype.markSeen=function(t){l.post(this.options.markSeenUrl,{data:{id:t}}).then(function(t){c.isDefined(t.messageCount)&&o.setMailMessageCount(t.messageCount)}).catch(function(t){r.log.error(t)})},n.prototype.loadUpdate=function(){var t=this.$.find(".mail-conversation-entry:not(.own):last").data("entry-id"),t={id:this.getActiveMessageId(),from:t},e=this;l.get(this.options.loadUpdateUrl,{data:t}).then(function(t){t.html&&i(t.html).each(function(){e.appendEntry(i(this))})})},n.prototype.reply=function(e){var o=this;l.submit(e).then(function(t){t.success?o.appendEntry(t.content).then(function(){o.$.find(".time").timeago();var t=o.getReplyRichtext(),t=(t&&t.$.trigger("clear"),o.getReplyFilePreview());t.length&&(t.hide(),t.children("ul.files").html("")),o.scrollToBottom(),u.isSmall()||o.focus(),s.instance("#inbox").updateEntries([o.getActiveMessageId()]),o.setLivePollInterval()}):r.log.error(t,!0)}).catch(function(t){r.log.error(t,!0)}).finally(function(t){a.reset(i(".reply-button")),e.finish()})},n.prototype.setLivePollInterval=function(){t("live").setDelay(5)},n.prototype.getReplyRichtext=function(){return s.instance(this.$.find(".ProsemirrorEditor"))},n.prototype.getReplyFilePreview=function(){return this.$.find(".post-file-list")},n.prototype.focus=function(t){var e=this.getReplyRichtext();e&&e.focus()},n.prototype.canLoadMore=function(){return!this.options.isLast},n.prototype.reload=function(){this.getActiveMessageId()&&this.loadMessage(this.getActiveMessageId())},n.prototype.addUser=function(t){var e=this;l.submit(t).then(function(t){t.result?e.$.find("#mail-conversation-header").html(t.result):t.error&&r.log.error(t,!0)}).catch(function(t){r.log.error(t,!0)})},n.prototype.appendEntry=function(t){var o,n=this,t=i(t);return n.$.find('[data-entry-id="'+t.data("entryId")+'"]').length?Promise.resolve():((o=t.not("script, link").filter(function(){return 1===this.nodeType})).css("opacity",0),this.getListNode().append(t),new Promise(function(t,e){o.css("opacity",1).fadeIn("fast",function(){n.onUpdate(),setTimeout(function(){n.scrollToBottom()},100),t()})}))},n.prototype.loadMessage=function(o){var n=c.isNumber(o)?o:o.$trigger.data("message-id"),i=this;this.loader(),l.get(this.options.loadMessageUrl,{data:{id:n}}).then(function(t){i.setActiveMessageId(n),i.options.isLast=!1;var e=s.instance("#inbox");return e.updateActiveItem(),e.hide(),o.$trigger&&history&&history.replaceState&&(e=o.$trigger.data("action-url"))&&history.replaceState(null,null,e),i.$.css("visibility","hidden"),i.updateContent(t.html)}).then(function(){return i.initScroll()}).catch(function(t){r.log.error(t,!0)}).finally(function(){i.loader(!1),i.$.css("visibility","visible"),i.initReplyRichText()})},n.prototype.initReplyRichText=function(){this.focus()},n.prototype.isScrolledToBottom=function(t){if(!this.getListNode().length)return!1;t=t||0;var e=this.getListNode()[0];return e.scrollHeight-e.offsetHeight-e.scrollTop<=t},n.prototype.initScroll=function(){var e,t,o,n;if(window.IntersectionObserver)return e=this.getListNode(),t=i('
'),e.prepend(t),o=this,n=new IntersectionObserver(function(t){o.preventScrollLoading()||t.length&&t[0].isIntersecting&&(a.prepend(e),o.loadMore().finally(function(){a.reset(e)}))},{root:e[0],rootMargin:"50px"}),this.assureScroll().then(function(){n.observe(t[0]),u.isLarge()&&(o.getListNode().niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:0,left:0,bottom:0}}),o.scrollDownButton=void 0,o.getListNode().on("scroll",()=>o.getScrollDownButton().toggle(!o.isScrolledToBottom())))})},n.prototype.getScrollDownButton=function(){return"object"!=typeof this.scrollDownButton&&(this.scrollDownButton=i("
").addClass("conversation-scroll-down-button").html('').on("click",()=>this.scrollToBottom()),this.getListNode().append(this.scrollDownButton)),this.scrollDownButton},n.prototype.loadMore=function(){var o=this,t={id:this.getActiveMessageId(),from:this.$.find(".mail-conversation-entry:first").data("entryId")};return l.get(this.options.loadMoreUrl,{data:t}).then(function(t){var e;t.result&&(e=i(t.result).hide(),o.getListNode().find(".conversation-stream-end").after(e),e.fadeIn()),o.options.isLast=!t.result||t.isLast}).catch(function(t){r.log.error(t,!0)})},n.prototype.preventScrollLoading=function(){return this.scrollLock||!this.canLoadMore()},n.prototype.canLoadMore=function(){return!this.options.isLast},n.prototype.assureScroll=function(){var t=this,e=this.getListNode();return e[0].offsetHeight>=e[0].scrollHeight&&this.canLoadMore()?this.loadMore().then(function(){return t.assureScroll()}).catch(function(){return Promise.resolve()}):t.scrollToBottom()},n.prototype.updateContent=function(e){var o=this;return new Promise(function(t){o.$.html(e),t()})},n.prototype.getActiveMessageId=function(){return this.options.messageId},n.prototype.setActiveMessageId=function(t){this.options.messageId=t},n.prototype.scrollToBottom=function(){var o=this;return new Promise(function(e){setTimeout(function(){o.$.imagesLoaded(function(){var t=o.getListNode();t.length&&(t[0].scrollTop=t[0].scrollHeight,e())})})})},n.prototype.getListNode=function(){return this.$.find(".conversation-entry-list")},n.prototype.onUpdate=function(){u.isLarge()&&this.getListNode().getNiceScroll().resize()},r.export=n}),humhub.module("mail.ConversationEntry",function(t,e,n){e=e("ui.widget").Widget.extend();e.prototype.replace=function(t){var e=this,o=n(t).hide();this.$.fadeOut(function(){n(this).replaceWith(o),e.$=o,e.$.fadeIn("slow")})},e.prototype.remove=function(){this.$.fadeToggle("slow",function(){n(this).remove()})},t.export=e}),humhub.module("mail.inbox",function(i,t,r){var e=t("ui.widget").Widget,o=t("ui.filter").Filter,n=t("ui.view"),s=t("ui.loader"),a=t("client"),t=o.extend(),o=(t.prototype.triggerChange=function(){this.super("triggerChange"),this.updateFilterCount()},t.prototype.updateFilterCount=function(){var t=this.getActiveFilterCount(),e=this.$.find("#conversation-filter-link"),o=e.find(".filterCount");t?(o=o.length?o:r('').insertBefore(e.find(".caret"))).html(" ("+t+") "):o.length&&o.remove()},e.extend()),l=(o.prototype.init=function(){this.filter=e.instance("#mail-filter-root"),this.initScroll(),this.initHeight();var t=this;this.filter.off("afterChange.inbox").on("afterChange.inbox",function(){t.reload().then(function(){t.updateActiveItem()})}),n.isLarge()&&this.$.niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:3,left:0,bottom:0}}),this.$.on("click",".entry",function(){t.$.find(".entry").removeClass("selected"),r(this).addClass("selected")})},o.prototype.initHeight=function(){var t=this.$.offset().top;r(":root").css("--hh-mail-offset-top",t+"px")},o.prototype.updateEntries=function(t){var o=this;t.length&&a.get(this.options.updateEntriesUrl,{data:{ids:t}}).then(function(t){t.result&&(r.each(t.result,function(t,e){t=o.getEntry(t);t.length?t.replaceWith(e):r(e).prependTo(o.$)}),o.updateActiveItem())}).catch(function(t){i.log.error(t)})},o.prototype.getEntry=function(t){return this.$.find('[data-message-id="'+t+'"]')},o.prototype.initScroll=function(){var t,e,o;window.IntersectionObserver&&(t=r('
'),this.$.append(t),e=this,o=new IntersectionObserver(function(t){e.preventScrollLoading()||t.length&&t[0].isIntersecting&&(s.append(e.$),e.loadMore().finally(function(){s.reset(e.$)}))},{root:this.$[0],rootMargin:"50px"}),this.assureScroll().then(function(){o.observe(t[0])}))},o.prototype.assureScroll=function(){var t=this;return this.$[0].offsetHeight>=this.$[0].scrollHeight&&this.canLoadMore()?this.loadMore().then(function(){return t.assureScroll()}).catch(function(){return Promise.resolve()}):Promise.resolve()},o.prototype.loadMore=function(){var n=this;return new Promise(function(e,o){var t=n.filter.getFilterMap();t.from=n.getLastMessageId(),a.get(n.options.loadMoreUrl,{data:t}).then(function(t){t.result&&(r(t.result).insertBefore(".inbox-stream-end"),n.$.find(".inbox-stream-end").append()),n.options.isLast=!t.result||t.isLast,n.updateActiveItem(),e()}).catch(function(t){i.log.error(t,!0),o()}).finally(function(){n.scrollLock=!1})})},o.prototype.preventScrollLoading=function(){return this.scrollLock||!this.canLoadMore()},o.prototype.canLoadMore=function(){return!this.options.isLast},o.prototype.getReloadOptions=function(){return{data:this.filter.getFilterMap()}},o.prototype.updateActiveItem=function(){var t;this.$.find(".entry").removeClass("selected"),c()&&(t=this.$.find('[data-message-id="'+c().getActiveMessageId()+'"]')).length&&t.removeClass("unread").addClass("selected")},o.prototype.getFirstMessageId=function(){return this.$.find(".entry:first").data("message-id")},o.prototype.getLastMessageId=function(){return this.$.find(".entry:last").data("message-id")},o.prototype.hide=function(){return new Promise(function(t){n.isSmall()&&r(".mail-conversation-single-message").length&&r(".inbox-wrapper").slideUp(function(){t()}),t()})},o.prototype.show=function(){return new Promise(function(t){n.isSmall()&&r(".inbox-wrapper").slideDown(function(){t()}),t()})},null),c=function(){return l=l||e.instance("#mail-conversation-root")};i.export({ConversationList:o,Filter:t,setTagFilter:function(t){e.instance("#inbox").show().then(function(){r("#mail-filter-menu").collapse("show"),e.instance("#inbox-tag-picker").setSelection([{id:t.$trigger.data("tagId"),text:t.$trigger.data("tagName"),image:t.$trigger.data("tagImage")}])})},toggleInbox:function(){n.isSmall()&&r(".inbox-wrapper").slideToggle()}})}),humhub.module("mail.conversation",function(n,t,r){function i(t){return s.instance('.mail-conversation-entry[data-entry-id="'+t+'"]')}var s=t("ui.widget").Widget,a=t("ui.modal"),o=t("client"),e=t("event"),l=t("mail.notification");n.export({init:function(){e.on("humhub:modules:mail:live:NewUserMessage",function(t,e){var o,n,i;r("#inbox").length&&(o=s.instance("#mail-conversation-root"),n=!1,i=[],e.forEach(function(t){i.push(t.data.message_id),!n&&o&&o.options.messageId==t.data.message_id&&(o.loadUpdate(),n=!0,o.markSeen(t.data.message_id))}),s.instance("#inbox").updateEntries(i))}).on("humhub:modules:mail:live:UserMessageDeleted",function(t,e,o){r("#inbox").length&&e.forEach(function(t){var e=i(t.data.entry_id);e&&e.remove(),l.setMailMessageCount(t.data.count)})})},linkAction:function(t){o.post(t).then(function(t){t.redirect&&o.pjax.redirect(t.redirect)}).catch(function(t){n.log.error(t,!0)})},submitEditEntry:function(o){a.submit(o).then(function(t){var e;t.success?(e=i(o.$trigger.data("entry-id")))&&setTimeout(function(){e.replace(t.content)},300):n.log.error(null,!0)}).catch(function(t){n.log.error(t,!0)})},deleteEntry:function(t){var e=i(t.$trigger.data("entry-id"));e?o.post(e.options.deleteUrl).then(function(t){a.global.close(),t.success&&setTimeout(function(){e.remove()},1e3)}).catch(function(t){n.log.error(t,!0)}):n.log.error(null,!0)}})}); \ No newline at end of file diff --git a/resources/js/humhub.mail.notification.min.js b/resources/js/humhub.mail.notification.min.js index 89f505a4..a68d8e33 100644 --- a/resources/js/humhub.mail.notification.min.js +++ b/resources/js/humhub.mail.notification.min.js @@ -1 +1 @@ -humhub.module("mail.notification",function(o,e,i){function n(){s.get(o.config.url.count).then(function(e){l(parseInt(e.newMessages))})}var a,s=e("client"),r=e("ui.loader"),t=e("event"),u=e("ui.widget").Widget,c=0,l=(o.initOnPjaxLoad=!0,function(e){var n=i("#badge-messages");e&&0!==parseInt(e)?(c=e,n.empty(),n.append(e),n.fadeIn("fast")):(n.css("display","none"),c=0),t.trigger("humhub:modules:notification:UpdateTitleNotificationCount")});o.export({init:function(e){e||(t.on("humhub:modules:mail:live:NewUserMessage",function(e,n){n=n[n.length-1];l(n.data.count)}).on("humhub:modules:mail:live:UserMessageDeleted",function(e,n){n=n[n.length-1];l(n.data.count)}),i("#icon-messages").click(function(){a&&a.abort();const n=i("#loader_messages"),t=n.parent();n.parent().find(":not(#loader_messages)").remove(),r.set(n.show()),s.get(o.config.url.list,{beforeSend:function(e){a=e}}).then(function(e){a=void 0,t.prepend(i(e.html)),n.hide(),t.niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:3,left:0,bottom:0}})})})),n()},loadMessage:function(e){var n=u.instance("#mail-conversation-root");n&&"function"==typeof n.loadMessage?(n.loadMessage(e),n.$.closest(".container").addClass("mail-conversation-single-message")):s.redirect(e.url),e.finish()},setMailMessageCount:l,updateCount:n,getNewMessageCount:function(){return c}})}); \ No newline at end of file +humhub.module("mail.notification",function(o,e,i){function n(){s.get(o.config.url.count).then(function(e){l(parseInt(e.newMessages))})}var a,s=e("client"),r=e("ui.loader"),t=e("event"),u=e("ui.widget").Widget,c=0,l=(o.initOnPjaxLoad=!0,function(e){var n=i("#badge-messages");e&&0!==parseInt(e)?(c=e,n.empty(),n.append(e),n.fadeIn("fast")):(n.css("display","none"),c=0),t.trigger("humhub:modules:notification:UpdateTitleNotificationCount")});o.export({init:function(e){e||(t.on("humhub:modules:mail:live:NewUserMessage",function(e,n){n=n[n.length-1];l(n.data.count)}).on("humhub:modules:mail:live:UserMessageDeleted",function(e,n){n=n[n.length-1];l(n.data.count)}),i("#icon-messages").click(function(){a&&a.abort();let n=i("#loader_messages"),t=n.parent();n.parent().find(":not(#loader_messages)").remove(),r.set(n.show()),s.get(o.config.url.list,{beforeSend:function(e){a=e}}).then(function(e){a=void 0,t.prepend(i(e.html)),n.hide(),t.niceScroll({cursorwidth:"7",cursorborder:"",cursorcolor:"#555",cursoropacitymax:"0.2",nativeparentscrolling:!1,railpadding:{top:0,right:3,left:0,bottom:0}})})})),n()},loadMessage:function(e){var n=u.instance("#mail-conversation-root");n&&"function"==typeof n.loadMessage?(n.loadMessage(e),n.$.closest(".container").addClass("mail-conversation-single-message")):s.redirect(e.url),e.finish()},setMailMessageCount:l,updateCount:n,getNewMessageCount:function(){return c}})}); \ No newline at end of file diff --git a/views/mail/conversation.php b/views/mail/conversation.php index 6845126f..8c06e4fa 100644 --- a/views/mail/conversation.php +++ b/views/mail/conversation.php @@ -39,7 +39,7 @@ $message]) ?> -
+
$message]) ?> @@ -47,59 +47,61 @@
-
- isBlocked()) : ?> -
- implode(', ', $message->getBlockerNames()) - ]); ?> -
- - false, 'acknowledge' => true]) ?> - -
- - field($replyForm, 'message')->widget(MailRichtextEditor::class, [ - 'id' => 'reply-' . time(), - 'layout' => AbstractRichTextEditor::LAYOUT_INLINE, - ])->label(false) ?> - -
- 'mail-create-upload-' . $message->id, - 'tooltip' => Yii::t('ContentModule.base', 'Attach Files'), - 'options' => ['class' => 'main_mail_upload'], - 'progress' => '#mail-create-upload-progress-' . $message->id, - 'preview' => '#mail-create-upload-preview-' . $message->id, - 'dropZone' => '#mail-create-form-' . $message->id, - 'max' => Yii::$app->getModule('content')->maxAttachedFiles, - 'cssButtonClass' => 'btn-sm btn-info', - ]) ?> - $uploadButton, - 'handlers' => $fileHandlers, - 'cssButtonClass' => 'btn-info btn-sm', - 'pullRight' => true, - ]) ?> - cssClass('reply-button') - ->submit() - ->action('reply', $replyForm->getUrl()) - ->icon('paper-plane-o') - ->sm() ?> +
+
+ isBlocked()) : ?> +
+ implode(', ', $message->getBlockerNames()) + ]); ?> +
+ + false, 'acknowledge' => true]) ?> + +
+ + field($replyForm, 'message')->widget(MailRichtextEditor::class, [ + 'id' => 'reply-' . time(), + 'layout' => AbstractRichTextEditor::LAYOUT_INLINE, + ])->label(false) ?> + +
+ 'mail-create-upload-' . $message->id, + 'tooltip' => Yii::t('ContentModule.base', 'Attach Files'), + 'options' => ['class' => 'main_mail_upload'], + 'progress' => '#mail-create-upload-progress-' . $message->id, + 'preview' => '#mail-create-upload-preview-' . $message->id, + 'dropZone' => '#mail-create-form-' . $message->id, + 'max' => Yii::$app->getModule('content')->maxAttachedFiles, + 'cssButtonClass' => 'btn-sm btn-info', + ]) ?> + $uploadButton, + 'handlers' => $fileHandlers, + 'cssButtonClass' => 'btn-info btn-sm', + 'pullRight' => true, + ]) ?> + cssClass('reply-button') + ->submit() + ->action('reply', $replyForm->getUrl()) + ->icon('paper-plane-o') + ->sm() ?> +
-
- + - 'mail-create-upload-preview-' . $message->id, - 'options' => ['style' => 'margin-top:10px;'], - 'edit' => true, - ]) ?> + 'mail-create-upload-preview-' . $message->id, + 'options' => ['style' => 'margin-top:10px;'], + 'edit' => true, + ]) ?> - - + + +