summaryrefslogtreecommitdiffstats
path: root/js-old/filter
diff options
context:
space:
mode:
authorJonathan Treffler <mail@jonathan-treffler.de>2020-08-07 11:06:13 +0200
committerSimon Spannagel <simonspa@kth.se>2021-12-16 19:49:12 +0100
commita2b48907f4f6d32d5d9c2350d9f11502506996b1 (patch)
tree7e235ab894327bfc6d5592125c3fcde4c4e5455c /js-old/filter
parentbe3db27ed3d7c75e054e54ea6ba0639cf29487dc (diff)
renamed js into js old
Signed-off-by: Jonathan Treffler <mail@jonathan-treffler.de>
Diffstat (limited to 'js-old/filter')
-rw-r--r--js-old/filter/TrustUrl.js16
-rw-r--r--js-old/filter/UnreadCountFormatter.js19
2 files changed, 35 insertions, 0 deletions
diff --git a/js-old/filter/TrustUrl.js b/js-old/filter/TrustUrl.js
new file mode 100644
index 000000000..69e763eba
--- /dev/null
+++ b/js-old/filter/TrustUrl.js
@@ -0,0 +1,16 @@
+/**
+ * Nextcloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Bernhard Posselt 2014
+ */
+app.filter('trustUrl', function ($sce) {
+ 'use strict';
+
+ return function (url) {
+ return $sce.trustAsResourceUrl(url);
+ };
+}); \ No newline at end of file
diff --git a/js-old/filter/UnreadCountFormatter.js b/js-old/filter/UnreadCountFormatter.js
new file mode 100644
index 000000000..51e275006
--- /dev/null
+++ b/js-old/filter/UnreadCountFormatter.js
@@ -0,0 +1,19 @@
+/**
+ * Nextcloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Bernhard Posselt 2014
+ */
+app.filter('unreadCountFormatter', function () {
+ 'use strict';
+
+ return function (unreadCount) {
+ if (unreadCount > 999) {
+ return '999+';
+ }
+ return unreadCount;
+ };
+}); \ No newline at end of file