nodebb-plugin-mentions 4.4.3 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +2 -2
- package/LICENSE +7 -7
- package/README.md +13 -13
- package/languages/ar/notifications.json +2 -2
- package/languages/bg/notifications.json +2 -2
- package/languages/bn/notifications.json +2 -2
- package/languages/da/notifications.json +2 -2
- package/languages/de/notifications.json +5 -5
- package/languages/el/notifications.json +2 -2
- package/languages/en@pirate/notifications.json +4 -4
- package/languages/en_GB/mentions.json +3 -3
- package/languages/en_GB/notifications.json +7 -7
- package/languages/en_US/notifications.json +4 -4
- package/languages/es/notifications.json +3 -3
- package/languages/et/notifications.json +2 -2
- package/languages/fa_IR/notifications.json +4 -4
- package/languages/fi/notifications.json +2 -2
- package/languages/fr/notifications.json +5 -5
- package/languages/gl/notifications.json +2 -2
- package/languages/id/notifications.json +2 -2
- package/languages/it/notifications.json +3 -3
- package/languages/ja/notifications.json +4 -4
- package/languages/jbo/notifications.json +4 -4
- package/languages/ko/notifications.json +2 -2
- package/languages/lt/notifications.json +2 -2
- package/languages/ms/notifications.json +2 -2
- package/languages/nl/notifications.json +2 -2
- package/languages/pl/mentions.json +3 -3
- package/languages/pl/notifications.json +6 -6
- package/languages/pt-PT/notifications.json +6 -6
- package/languages/pt_BR/notifications.json +3 -3
- package/languages/ro/notifications.json +2 -2
- package/languages/rw/notifications.json +2 -2
- package/languages/sl/notifications.json +2 -2
- package/languages/sr/notifications.json +2 -2
- package/languages/sv/notifications.json +2 -2
- package/languages/tr/notifications.json +6 -6
- package/languages/vi/notifications.json +2 -2
- package/languages/zh-CN/mentions.json +3 -3
- package/languages/zh-CN/notifications.json +5 -5
- package/languages/zh_TW/notifications.json +2 -2
- package/library.js +25 -8
- package/package.json +1 -1
- package/plugin.json +31 -31
- package/static/.eslintrc +3 -3
- package/static/autofill.js +41 -14
package/.eslintrc
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "nodebb/lib"
|
|
1
|
+
{
|
|
2
|
+
"extends": "nodebb/lib"
|
|
3
3
|
}
|
package/LICENSE
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
Copyright (c) 2013-2014, Julian Lam <julian@designcreateplay.com>
|
|
2
|
-
All rights reserved.
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
-
|
|
6
|
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
1
|
+
Copyright (c) 2013-2014, Julian Lam <julian@designcreateplay.com>
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
8
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# Username/Group Mentions
|
|
2
|
-
|
|
3
|
-
This NodeBB plugin allows posters to reference (or *mention*) other users or groups on a NodeBB by simply
|
|
4
|
-
precluding the `@` symbol before a username.
|
|
5
|
-
|
|
6
|
-
A link is automatically added to the post.
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
This plugin is bundled with every NodeBB install. If not, you can install it via the Plugins page of the ACP.
|
|
11
|
-
|
|
12
|
-
Alternatively,
|
|
13
|
-
|
|
1
|
+
# Username/Group Mentions
|
|
2
|
+
|
|
3
|
+
This NodeBB plugin allows posters to reference (or *mention*) other users or groups on a NodeBB by simply
|
|
4
|
+
precluding the `@` symbol before a username.
|
|
5
|
+
|
|
6
|
+
A link is automatically added to the post.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
This plugin is bundled with every NodeBB install. If not, you can install it via the Plugins page of the ACP.
|
|
11
|
+
|
|
12
|
+
Alternatively,
|
|
13
|
+
|
|
14
14
|
npm install nodebb-plugin-mentions
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> ذكرَ اسمك في <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> ذكرَ اسمك في <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> Ви спомена в <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> Ви спомена в <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong>, <strong>%2</strong> এ আপনার নাম উল্লেখ করেছেন"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong>, <strong>%2</strong> এ আপনার নাম উল্লেখ করেছেন"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> nævnte dig i <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> nævnte dig i <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Erwähnungen",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> erwähnte dich in <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> erwähnte <strong>%2</strong> in <strong>%3</strong>",
|
|
5
|
-
"notificationType_mention": "Wenn dich jemand erwähnt"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Erwähnungen",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> erwähnte dich in <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> erwähnte <strong>%2</strong> in <strong>%3</strong>",
|
|
5
|
+
"notificationType_mention": "Wenn dich jemand erwähnt"
|
|
6
6
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "Ο/Η <strong>%1</strong> σε ανέφερε στο <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "Ο/Η <strong>%1</strong> σε ανέφερε στο <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> spoke yer name in <strong>%2</strong>",
|
|
3
|
-
"user-mentioned-group-in": "<strong>%1</strong> called fer <strong>%2</strong> in <strong>%3</strong>"
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> spoke yer name in <strong>%2</strong>",
|
|
3
|
+
"user-mentioned-group-in": "<strong>%1</strong> called fer <strong>%2</strong> in <strong>%3</strong>"
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>"
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Mentions",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-you-in-room": "<strong>%1</strong> mentioned you in <strong class=\"text-nowrap\"><i class=\"fa %2\"></i>%3</strong>",
|
|
5
|
-
"user-mentioned-group-in": "<strong>%1</strong> mentioned <strong>%2</strong> in <strong>%3</strong>",
|
|
6
|
-
"notificationType-mention": "When someone mentions you"
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Mentions",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-you-in-room": "<strong>%1</strong> mentioned you in <strong class=\"text-nowrap\"><i class=\"fa %2\"></i>%3</strong>",
|
|
5
|
+
"user-mentioned-group-in": "<strong>%1</strong> mentioned <strong>%2</strong> in <strong>%3</strong>",
|
|
6
|
+
"notificationType-mention": "When someone mentions you"
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>",
|
|
3
|
-
"user-mentioned-group-in": "<strong>%1</strong> mentioned <strong>%2</strong> in <strong>%3</strong>"
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>",
|
|
3
|
+
"user-mentioned-group-in": "<strong>%1</strong> mentioned <strong>%2</strong> in <strong>%3</strong>"
|
|
4
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Menciones",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> te mencionó en <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Menciones",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> te mencionó en <strong>%2</strong>"
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> mainis sind postituses <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> mainis sind postituses <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> شما رو در <strong>%2</strong> منشن کرده",
|
|
3
|
-
"user-mentioned-group-in": "<strong>%1</strong> گروه <strong>%2</strong> رو در <strong>%3</strong> منشن کرده"
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> شما رو در <strong>%2</strong> منشن کرده",
|
|
3
|
+
"user-mentioned-group-in": "<strong>%1</strong> گروه <strong>%2</strong> رو در <strong>%3</strong> منشن کرده"
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> mainitsi sinut viestissä <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> mainitsi sinut viestissä <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Mentions",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> vous a mentionné dans <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> a mentionné <strong>%2</strong> dans <strong>%3</strong>",
|
|
5
|
-
"notificationType_mention": "Lorsque quelqu'un vous mentionne"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Mentions",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> vous a mentionné dans <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> a mentionné <strong>%2</strong> dans <strong>%3</strong>",
|
|
5
|
+
"notificationType_mention": "Lorsque quelqu'un vous mentionne"
|
|
6
6
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> mencionóute en <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> mencionóute en <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> menyebut mu di <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> menyebut mu di <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Menzioni",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> ti ha menzionato in <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Menzioni",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> ti ha menzionato in <strong>%2</strong>"
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "メンション",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> mentioned <strong>%2</strong> in <strong>%3</strong>"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "メンション",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> mentioned you in <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> mentioned <strong>%2</strong> in <strong>%3</strong>"
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "la .<strong>%1</strong>. klacpe do la .<strong>%2</strong>.",
|
|
3
|
-
"user-mentioned-group-in": "la .<strong>%1</strong>. klacpe la .<strong>%2</strong>. la .<strong>%3</strong>."
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "la .<strong>%1</strong>. klacpe do la .<strong>%2</strong>.",
|
|
3
|
+
"user-mentioned-group-in": "la .<strong>%1</strong>. klacpe la .<strong>%2</strong>. la .<strong>%3</strong>."
|
|
4
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong>님이 <strong>%2</strong>에서 나를 언급했습니다."
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong>님이 <strong>%2</strong>에서 나를 언급했습니다."
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> paminėjo Jus <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> paminėjo Jus <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> sebut anda di <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> sebut anda di <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "Onze naam is genoemd door <strong>%1</strong> in <strong>%2</strong>."
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "Onze naam is genoemd door <strong>%1</strong> in <strong>%2</strong>."
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> wspomniał o Tobie w <strong>%2</strong>"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> wspomniał o Tobie w <strong>%2</strong>"
|
|
3
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Wspomnienia",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> wspomniał o Tobie w <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> wspomniał <strong>%2</strong> w <strong>%3</strong>",
|
|
5
|
-
"notificationType_mention": "Kiedy ktoś o Tobie wspomni"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Wspomnienia",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> wspomniał o Tobie w <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> wspomniał <strong>%2</strong> w <strong>%3</strong>",
|
|
5
|
+
"notificationType_mention": "Kiedy ktoś o Tobie wspomni"
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Menções",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> mencionou-te no tópico <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> mencionou o grupo <strong>%2</strong> no tópico <strong>%3</strong>",
|
|
5
|
-
"notificationType_mention": "Quando alguém te menciona"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Menções",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> mencionou-te no tópico <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> mencionou o grupo <strong>%2</strong> no tópico <strong>%3</strong>",
|
|
5
|
+
"notificationType_mention": "Quando alguém te menciona"
|
|
6
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Menções",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> mencionou você em <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Menções",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> mencionou você em <strong>%2</strong>"
|
|
4
4
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> te-a menționat în <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> te-a menționat în <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> yakuvuze muri <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> yakuvuze muri <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> te je omenil v <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> te je omenil v <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> вас помену у <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> вас помену у <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> nämnde dig i <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> nämnde dig i <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "Bahsedilmeler",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> sizden şu konuda bahsetti: <strong>%2</strong>",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> kullanıcısı <strong>%2</strong> grubundan şu konuda bahsetti: <strong>%3</strong>",
|
|
5
|
-
"notificationType_mention": "Biri sizden bahsettiğinde"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"mentions": "Bahsedilmeler",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> sizden şu konuda bahsetti: <strong>%2</strong>",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> kullanıcısı <strong>%2</strong> grubundan şu konuda bahsetti: <strong>%3</strong>",
|
|
5
|
+
"notificationType_mention": "Biri sizden bahsettiğinde"
|
|
6
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> nhắc đến bạn trong <strong>%2</strong>"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> nhắc đến bạn trong <strong>%2</strong>"
|
|
3
3
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong> 中提到了您"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong> 中提到了您"
|
|
3
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "提到",
|
|
3
|
-
"user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong> 中提到了你",
|
|
4
|
-
"user-mentioned-group-in": "<strong>%1</strong> 在 <strong>%3</strong> 中提到了 <strong>%2</strong>",
|
|
5
|
-
"notificationType_mention": "当有人提到你时"
|
|
1
|
+
{
|
|
2
|
+
"mentions": "提到",
|
|
3
|
+
"user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong> 中提到了你",
|
|
4
|
+
"user-mentioned-group-in": "<strong>%1</strong> 在 <strong>%3</strong> 中提到了 <strong>%2</strong>",
|
|
5
|
+
"notificationType_mention": "当有人提到你时"
|
|
6
6
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong>提到你"
|
|
1
|
+
{
|
|
2
|
+
"user-mentioned-you-in": "<strong>%1</strong> 在 <strong>%2</strong>提到你"
|
|
3
3
|
}
|
package/library.js
CHANGED
|
@@ -12,6 +12,7 @@ const winston = require.main.require('winston');
|
|
|
12
12
|
const db = require.main.require('./src/database');
|
|
13
13
|
const api = require.main.require('./src/api');
|
|
14
14
|
const meta = require.main.require('./src/meta');
|
|
15
|
+
const categories = require.main.require('./src/categories');
|
|
15
16
|
const Topics = require.main.require('./src/topics');
|
|
16
17
|
const posts = require.main.require('./src/posts');
|
|
17
18
|
const User = require.main.require('./src/user');
|
|
@@ -393,18 +394,34 @@ Mentions.parseRaw = async (content) => {
|
|
|
393
394
|
const slug = slugify(match.slice(1));
|
|
394
395
|
match = removePunctuationSuffix(match);
|
|
395
396
|
const uid = await User.getUidByUserslug(slug);
|
|
396
|
-
const
|
|
397
|
+
const cid = await categories.getCidByHandle(slug);
|
|
398
|
+
const { groupExists, user, category } = await utils.promiseParallel({
|
|
397
399
|
groupExists: Groups.existsBySlug(slug),
|
|
398
|
-
user: User.getUserFields(uid, ['uid', 'username', 'fullname']),
|
|
400
|
+
user: User.getUserFields(uid, ['uid', 'username', 'fullname', 'url']),
|
|
401
|
+
category: categories.getCategoryFields(cid, ['slug']),
|
|
399
402
|
});
|
|
400
403
|
|
|
401
|
-
if (
|
|
404
|
+
if (uid || groupExists || cid) {
|
|
402
405
|
let url;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
406
|
+
|
|
407
|
+
switch (true) {
|
|
408
|
+
case !!uid: {
|
|
409
|
+
url = utils.isNumber(user.uid) ? `${nconf.get('url')}/uid/${user.uid}` : (user.url || user.uid);
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
case !!cid: {
|
|
414
|
+
url = `${nconf.get('url')}/category/${category.slug}`;
|
|
415
|
+
console.log('setting url', url);
|
|
416
|
+
break;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
case !!groupExists: {
|
|
420
|
+
url = `${nconf.get('url')}/groups/${slug}`;
|
|
421
|
+
break;
|
|
422
|
+
}
|
|
407
423
|
}
|
|
424
|
+
|
|
408
425
|
const regex = isLatinMention.test(match) ?
|
|
409
426
|
RegExp(`${parts.before}${match}${parts.after}`, 'gu') :
|
|
410
427
|
RegExp(`${parts.before}${match}`, 'gu');
|
|
@@ -432,7 +449,7 @@ Mentions.parseRaw = async (content) => {
|
|
|
432
449
|
}
|
|
433
450
|
}
|
|
434
451
|
|
|
435
|
-
const str = `<a class="
|
|
452
|
+
const str = `<a class="plugin-mentions-${user.uid ? 'user' : 'group'} plugin-mentions-a" href="${url}">${match}</a>`;
|
|
436
453
|
|
|
437
454
|
return plain + str;
|
|
438
455
|
});
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "nodebb-plugin-mentions",
|
|
3
|
-
"name": "Username Mentions",
|
|
4
|
-
"description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
|
|
5
|
-
"url": "https://github.com/julianlam/nodebb-plugin-mentions",
|
|
6
|
-
"library": "./library.js",
|
|
7
|
-
"upgrades": [
|
|
8
|
-
"upgrades/mentions_delete_mentions_set_zset.js"
|
|
9
|
-
],
|
|
10
|
-
"hooks": [
|
|
11
|
-
{ "hook": "static:app.load", "method": "init" },
|
|
12
|
-
{ "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
|
|
13
|
-
{ "hook": "filter:parse.post", "method": "parsePost" },
|
|
14
|
-
{ "hook": "filter:parse.raw", "method": "parseRaw" },
|
|
15
|
-
{ "hook": "action:post.save", "method": "notify" },
|
|
16
|
-
{ "hook": "action:post.edit", "method": "notify" },
|
|
17
|
-
{ "hook": "action:posts.purge", "method": "actionPostsPurge" },
|
|
18
|
-
{ "hook": "action:messaging.save", "method": "notifyMessage" },
|
|
19
|
-
{ "hook": "filter:notifications.addFilters", "method": "addFilters" },
|
|
20
|
-
{ "hook": "filter:user.notificationTypes", "method": "notificationTypes" },
|
|
21
|
-
{ "hook": "filter:users.addFields", "method": "addFields" }
|
|
22
|
-
],
|
|
23
|
-
"scripts": [
|
|
24
|
-
"static/autofill.js"
|
|
25
|
-
],
|
|
26
|
-
"modules": {
|
|
27
|
-
"../admin/plugins/mentions.js": "./static/admin.js"
|
|
28
|
-
},
|
|
29
|
-
"languages": "languages",
|
|
30
|
-
"defaultLang": "en_GB",
|
|
31
|
-
"templates": "templates"
|
|
1
|
+
{
|
|
2
|
+
"id": "nodebb-plugin-mentions",
|
|
3
|
+
"name": "Username Mentions",
|
|
4
|
+
"description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
|
|
5
|
+
"url": "https://github.com/julianlam/nodebb-plugin-mentions",
|
|
6
|
+
"library": "./library.js",
|
|
7
|
+
"upgrades": [
|
|
8
|
+
"upgrades/mentions_delete_mentions_set_zset.js"
|
|
9
|
+
],
|
|
10
|
+
"hooks": [
|
|
11
|
+
{ "hook": "static:app.load", "method": "init" },
|
|
12
|
+
{ "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
|
|
13
|
+
{ "hook": "filter:parse.post", "method": "parsePost" },
|
|
14
|
+
{ "hook": "filter:parse.raw", "method": "parseRaw" },
|
|
15
|
+
{ "hook": "action:post.save", "method": "notify" },
|
|
16
|
+
{ "hook": "action:post.edit", "method": "notify" },
|
|
17
|
+
{ "hook": "action:posts.purge", "method": "actionPostsPurge" },
|
|
18
|
+
{ "hook": "action:messaging.save", "method": "notifyMessage" },
|
|
19
|
+
{ "hook": "filter:notifications.addFilters", "method": "addFilters" },
|
|
20
|
+
{ "hook": "filter:user.notificationTypes", "method": "notificationTypes" },
|
|
21
|
+
{ "hook": "filter:users.addFields", "method": "addFields" }
|
|
22
|
+
],
|
|
23
|
+
"scripts": [
|
|
24
|
+
"static/autofill.js"
|
|
25
|
+
],
|
|
26
|
+
"modules": {
|
|
27
|
+
"../admin/plugins/mentions.js": "./static/admin.js"
|
|
28
|
+
},
|
|
29
|
+
"languages": "languages",
|
|
30
|
+
"defaultLang": "en_GB",
|
|
31
|
+
"templates": "templates"
|
|
32
32
|
}
|
package/static/.eslintrc
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "nodebb/public"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "nodebb/public"
|
|
3
|
+
}
|
package/static/autofill.js
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
$(document).ready(function () {
|
|
5
5
|
let groupList = [];
|
|
6
|
+
let categoryList;
|
|
7
|
+
const categorySlugMap = new Map();
|
|
6
8
|
let localUserList = [];
|
|
7
9
|
|
|
8
10
|
$(window).on('composer:autocomplete:init chat:autocomplete:init', function (ev, data) {
|
|
@@ -12,6 +14,10 @@ $(document).ready(function () {
|
|
|
12
14
|
loadGroupList();
|
|
13
15
|
}
|
|
14
16
|
|
|
17
|
+
if (!categoryList) {
|
|
18
|
+
loadCategoryList();
|
|
19
|
+
}
|
|
20
|
+
|
|
15
21
|
let slugify;
|
|
16
22
|
const strategy = {
|
|
17
23
|
match: /\B@([^\s\n]*)?$/,
|
|
@@ -20,7 +26,7 @@ $(document).ready(function () {
|
|
|
20
26
|
slugify = _slugify;
|
|
21
27
|
let mentions = [];
|
|
22
28
|
if (!term) {
|
|
23
|
-
mentions =
|
|
29
|
+
mentions = entriesToMentions(sortEntries(localUserList), helpers);
|
|
24
30
|
return callback(mentions);
|
|
25
31
|
}
|
|
26
32
|
|
|
@@ -37,10 +43,12 @@ $(document).ready(function () {
|
|
|
37
43
|
const localMatches = localUserList.filter(
|
|
38
44
|
u => u.username.toLocaleLowerCase().startsWith(termLowerCase)
|
|
39
45
|
);
|
|
46
|
+
const categoryMatches = categoryList.filter(c => c.handle.startsWith(termLowerCase));
|
|
40
47
|
|
|
41
|
-
// remove local matches from search results
|
|
48
|
+
// remove local matches from search results, add category matches
|
|
42
49
|
users = users.filter(u => !localMatches.find(lu => lu.uid === u.uid));
|
|
43
|
-
|
|
50
|
+
users = sortEntries(localMatches).concat(sortEntries([...users, ...categoryMatches]));
|
|
51
|
+
mentions = entriesToMentions(users, helpers);
|
|
44
52
|
|
|
45
53
|
// Add groups that start with the search term
|
|
46
54
|
const groupMentions = groupList.filter(function (groupName) {
|
|
@@ -62,7 +70,14 @@ $(document).ready(function () {
|
|
|
62
70
|
mention = $('<div/>').html(mention);
|
|
63
71
|
// Strip letter avatar
|
|
64
72
|
mention.find('span').remove();
|
|
65
|
-
|
|
73
|
+
|
|
74
|
+
const text = mention.text().trim();
|
|
75
|
+
const categoryHandle = categorySlugMap.get(text.toLowerCase());
|
|
76
|
+
if (categoryHandle) {
|
|
77
|
+
return `@${categoryHandle}`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return '@' + slugify(text, true) + ' ';
|
|
66
81
|
},
|
|
67
82
|
cache: true,
|
|
68
83
|
};
|
|
@@ -75,23 +90,25 @@ $(document).ready(function () {
|
|
|
75
90
|
composer.attr('data-mentions', '1');
|
|
76
91
|
});
|
|
77
92
|
|
|
78
|
-
function
|
|
79
|
-
return
|
|
80
|
-
|
|
93
|
+
function sortEntries(entries) {
|
|
94
|
+
return entries.sort(function (entry1, entry2) {
|
|
95
|
+
const comparator1 = entry1.username || entry1.name;
|
|
96
|
+
const comparator2 = entry2.username || entry2.name;
|
|
97
|
+
return comparator1.toLocaleLowerCase() > comparator2.toLocaleLowerCase() ? 1 : -1;
|
|
81
98
|
});
|
|
82
99
|
}
|
|
83
100
|
|
|
84
|
-
function
|
|
85
|
-
return
|
|
101
|
+
function entriesToMentions(entries, helpers) {
|
|
102
|
+
return entries.reduce(function (carry, entry) {
|
|
86
103
|
// Don't add current user to suggestions
|
|
87
|
-
if (app.user.username && app.user.username ===
|
|
104
|
+
if (app.user.username && app.user.username === entry.username) {
|
|
88
105
|
return carry;
|
|
89
106
|
}
|
|
90
107
|
|
|
91
|
-
// Format suggestions as 'avatar username (fullname)'
|
|
92
|
-
const avatar = helpers.buildAvatar(
|
|
93
|
-
const fullname =
|
|
94
|
-
carry.push(`${avatar} ${
|
|
108
|
+
// Format suggestions as 'avatar username/name (fullname)'
|
|
109
|
+
const avatar = entry.uid ? helpers.buildAvatar(entry, '24px', true) : '';
|
|
110
|
+
const fullname = entry.fullname ? `(${entry.fullname})` : '';
|
|
111
|
+
carry.push(`${avatar} ${entry.username || entry.name} ${helpers.escape(fullname)}`);
|
|
95
112
|
|
|
96
113
|
return carry;
|
|
97
114
|
}, []);
|
|
@@ -141,4 +158,14 @@ $(document).ready(function () {
|
|
|
141
158
|
groupList = groupNames;
|
|
142
159
|
});
|
|
143
160
|
}
|
|
161
|
+
|
|
162
|
+
function loadCategoryList() {
|
|
163
|
+
require(['api'], async (api) => {
|
|
164
|
+
const { categories } = await api.get('/categories');
|
|
165
|
+
categoryList = categories;
|
|
166
|
+
categories.forEach((category) => {
|
|
167
|
+
categorySlugMap.set(category.name.toLowerCase(), category.handle);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
144
171
|
});
|