nodebb-plugin-mentions 4.6.5 → 4.6.7
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 +43 -68
- package/package.json +2 -2
- package/plugin.json +31 -31
- package/static/.eslintrc +3 -3
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
|
@@ -36,7 +36,6 @@ const parts = {
|
|
|
36
36
|
};
|
|
37
37
|
const regex = RegExp(`${parts.before}${parts.main}`, 'gu');
|
|
38
38
|
const isLatinMention = /@[\w\d\-_.@]+$/;
|
|
39
|
-
const anchorRegex = /<a.*?href=['"](.+?)['"].*?>(.*?)<\/a>/ig;
|
|
40
39
|
|
|
41
40
|
const Mentions = module.exports;
|
|
42
41
|
|
|
@@ -356,49 +355,36 @@ async function getMatches(content, isMarkdown = false) {
|
|
|
356
355
|
}
|
|
357
356
|
});
|
|
358
357
|
|
|
359
|
-
|
|
360
|
-
if (isMarkdown) {
|
|
361
|
-
return { splitContent, matches, urlMap: new Map() };
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// Find matches via backreferenced href
|
|
365
|
-
const joined = splitContent.join('');
|
|
366
|
-
const anchors = new Set(joined.matchAll(anchorRegex));
|
|
367
|
-
const urlMap = new Map();
|
|
368
|
-
const urls = new Set();
|
|
369
|
-
if (!isMarkdown && anchors.size) {
|
|
370
|
-
anchors.forEach((match) => {
|
|
371
|
-
const [, url] = match;
|
|
372
|
-
urls.add(url);
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
// Filter out urls that don't backreference to a remote id
|
|
376
|
-
const backrefs = urls.size ? await db.getObjectFields('remoteUrl:uid', Array.from(urls)) : {};
|
|
377
|
-
const urlAsIdExists = await db.isSortedSetMembers('usersRemote:lastCrawled', Array.from(urls));
|
|
378
|
-
Array.from(urls).map(async (url, index) => {
|
|
379
|
-
if (backrefs[url] || urlAsIdExists[index]) {
|
|
380
|
-
urlMap.set(url, backrefs[url] || url);
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
let slugs = await User.getUsersFields(Array.from(urlMap.values()), ['userslug']);
|
|
384
|
-
slugs = slugs.map(({ userslug }) => userslug);
|
|
385
|
-
Array.from(urlMap.keys()).forEach((url, idx) => {
|
|
386
|
-
urlMap.set(url, `/user/${encodeURIComponent(slugs[idx])}`);
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
return { splitContent, matches, urlMap };
|
|
358
|
+
return { splitContent, matches };
|
|
391
359
|
}
|
|
392
360
|
|
|
393
361
|
Mentions.getMatches = async (content) => {
|
|
394
362
|
// Exported method only accepts markdown, also filters out dupes and matches to ensure slugs exist
|
|
395
363
|
let { matches } = await getMatches(content, true);
|
|
396
364
|
matches = await filterMatches(matches);
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
365
|
+
const normalized = matches.map(match => match.slice(1).toLowerCase());
|
|
366
|
+
const [uids, cids] = await Promise.all([
|
|
367
|
+
User.getUidsByUserslugs(normalized),
|
|
368
|
+
db.sortedSetScores('categoryhandle:cid', normalized),
|
|
369
|
+
]);
|
|
370
|
+
|
|
371
|
+
matches = matches.map((slug, idx) => {
|
|
372
|
+
if (uids[idx]) {
|
|
373
|
+
return {
|
|
374
|
+
type: 'uid',
|
|
375
|
+
id: uids[idx],
|
|
376
|
+
slug,
|
|
377
|
+
};
|
|
378
|
+
} else if (cids[idx]) {
|
|
379
|
+
return {
|
|
380
|
+
type: 'cid',
|
|
381
|
+
id: cids[idx],
|
|
382
|
+
slug,
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return false;
|
|
387
|
+
}).filter(Boolean);
|
|
402
388
|
|
|
403
389
|
return new Set(matches);
|
|
404
390
|
};
|
|
@@ -416,9 +402,9 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
416
402
|
}
|
|
417
403
|
|
|
418
404
|
// Note: Mentions.clean explicitly can't be called here because I need the content unstripped
|
|
419
|
-
let { splitContent, matches
|
|
405
|
+
let { splitContent, matches } = await getMatches(content);
|
|
420
406
|
|
|
421
|
-
if (!matches.length
|
|
407
|
+
if (!matches.length) {
|
|
422
408
|
return content;
|
|
423
409
|
}
|
|
424
410
|
|
|
@@ -436,19 +422,23 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
436
422
|
await Promise.all(matches.map(async (match) => {
|
|
437
423
|
const slug = slugify(match.slice(1));
|
|
438
424
|
match = removePunctuationSuffix(match);
|
|
425
|
+
let cid = 0;
|
|
426
|
+
let groupExists = 0;
|
|
439
427
|
const uid = await User.getUidByUserslug(slug);
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
}
|
|
428
|
+
if (!uid) {
|
|
429
|
+
({ groupExists, cid } = await utils.promiseParallel({
|
|
430
|
+
groupExists: Groups.existsBySlug(slug),
|
|
431
|
+
cid: categories.getCidByHandle(slug),
|
|
432
|
+
}));
|
|
433
|
+
}
|
|
446
434
|
|
|
447
435
|
if (uid || groupExists || cid) {
|
|
448
436
|
let url;
|
|
449
|
-
|
|
437
|
+
let user;
|
|
438
|
+
let mentionType = 'user';
|
|
450
439
|
switch (true) {
|
|
451
440
|
case !!uid: {
|
|
441
|
+
user = await User.getUserFields(uid, ['uid', 'username', 'userslug', 'fullname', 'url']);
|
|
452
442
|
url = `/user/${encodeURIComponent(user.userslug)}`;
|
|
453
443
|
if (type.startsWith('activitypub') && !utils.isNumber(uid)) {
|
|
454
444
|
url = user.url || user.uid;
|
|
@@ -457,11 +447,14 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
457
447
|
}
|
|
458
448
|
|
|
459
449
|
case !!cid: {
|
|
450
|
+
mentionType = 'category';
|
|
451
|
+
const category = await categories.getCategoryFields(cid, ['slug']);
|
|
460
452
|
url = `/category/${category.slug}`;
|
|
461
453
|
break;
|
|
462
454
|
}
|
|
463
455
|
|
|
464
456
|
case !!groupExists: {
|
|
457
|
+
mentionType = 'group';
|
|
465
458
|
url = `/groups/${slug}`;
|
|
466
459
|
break;
|
|
467
460
|
}
|
|
@@ -483,7 +476,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
483
476
|
const atIndex = match.indexOf('@');
|
|
484
477
|
const plain = match.slice(0, atIndex);
|
|
485
478
|
match = match.slice(atIndex);
|
|
486
|
-
if (user.uid) {
|
|
479
|
+
if (user && user.uid) {
|
|
487
480
|
switch (Mentions._settings.display) {
|
|
488
481
|
case 'fullname':
|
|
489
482
|
match = user.fullname || match;
|
|
@@ -494,7 +487,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
494
487
|
}
|
|
495
488
|
}
|
|
496
489
|
|
|
497
|
-
const str = `<a class="plugin-mentions-${
|
|
490
|
+
const str = `<a class="plugin-mentions-${mentionType} plugin-mentions-a" href="${url}">${match}</a>`;
|
|
498
491
|
|
|
499
492
|
return plain + str;
|
|
500
493
|
});
|
|
@@ -502,25 +495,7 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
502
495
|
}
|
|
503
496
|
}));
|
|
504
497
|
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
// Early return if no urls to modify
|
|
508
|
-
if (!urlMap.size) {
|
|
509
|
-
return parsed;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
// Modify existing anchors to local profile
|
|
513
|
-
const anchors = new Set(Array.from(parsed.matchAll(anchorRegex)).reverse());
|
|
514
|
-
if (!anchors.size) {
|
|
515
|
-
return parsed;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
anchors.forEach(([match, href]) => {
|
|
519
|
-
const replacement = match.replace(href, urlMap.get(href));
|
|
520
|
-
parsed = parsed.split(match).join(replacement);
|
|
521
|
-
});
|
|
522
|
-
|
|
523
|
-
return parsed;
|
|
498
|
+
return splitContent.join('');
|
|
524
499
|
};
|
|
525
500
|
|
|
526
501
|
Mentions.clean = function (input, isMarkdown, stripBlockquote, stripCode) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-mentions",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.7",
|
|
4
4
|
"description": "NodeBB Plugin that allows users to mention other users by prepending an '@' sign to their username",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
"eslint": "^9.0.0",
|
|
31
31
|
"eslint-config-nodebb": "0.2.1",
|
|
32
32
|
"eslint-plugin-import": "2.29.1",
|
|
33
|
-
"mocha": "10.
|
|
33
|
+
"mocha": "10.6.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
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
|
+
}
|