nodebb-plugin-mentions 4.6.1 → 4.6.3
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 +31 -26
- package/package.json +4 -6
- 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
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
const _ = require('lodash');
|
|
6
6
|
const validator = require('validator');
|
|
7
7
|
const entitiesDecode = require('html-entities').decode;
|
|
8
|
-
const cheerio = require('cheerio');
|
|
9
8
|
|
|
10
9
|
const nconf = require.main.require('nconf');
|
|
11
10
|
const winston = require.main.require('winston');
|
|
@@ -37,7 +36,7 @@ const parts = {
|
|
|
37
36
|
};
|
|
38
37
|
const regex = RegExp(`${parts.before}${parts.main}`, 'gu');
|
|
39
38
|
const isLatinMention = /@[\w\d\-_.@]+$/;
|
|
40
|
-
const
|
|
39
|
+
const anchorRegex = /<a.*?href=['"](.+?)['"].*?>(.*?)<\/a>/ig;
|
|
41
40
|
|
|
42
41
|
const Mentions = module.exports;
|
|
43
42
|
|
|
@@ -357,23 +356,24 @@ async function getMatches(content, isMarkdown = false) {
|
|
|
357
356
|
}
|
|
358
357
|
});
|
|
359
358
|
|
|
359
|
+
// Early return
|
|
360
|
+
if (isMarkdown) {
|
|
361
|
+
return { splitContent, matches, urlMap: new Map() };
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Find matches via backreferenced href
|
|
360
365
|
const joined = splitContent.join('');
|
|
361
|
-
const
|
|
366
|
+
const anchors = new Set(joined.matchAll(anchorRegex));
|
|
362
367
|
const urlMap = new Map();
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const text = $(anchor).prop('innerText');
|
|
369
|
-
const match = text.match(regex);
|
|
370
|
-
if (match) {
|
|
371
|
-
urls.add($(anchor).attr('href'));
|
|
372
|
-
}
|
|
368
|
+
const urls = new Set();
|
|
369
|
+
if (!isMarkdown && anchors.size) {
|
|
370
|
+
anchors.forEach((match) => {
|
|
371
|
+
const [, url] = match;
|
|
372
|
+
urls.add(url);
|
|
373
373
|
});
|
|
374
374
|
|
|
375
375
|
// Filter out urls that don't backreference to a remote id
|
|
376
|
-
const backrefs = await db.getObjectFields('remoteUrl:uid', Array.from(urls));
|
|
376
|
+
const backrefs = urls.size ? await db.getObjectFields('remoteUrl:uid', Array.from(urls)) : {};
|
|
377
377
|
const urlAsIdExists = await db.isSortedSetMembers('usersRemote:lastCrawled', Array.from(urls));
|
|
378
378
|
Array.from(urls).map(async (url, index) => {
|
|
379
379
|
if (backrefs[url] || urlAsIdExists[index]) {
|
|
@@ -394,7 +394,7 @@ Mentions.getMatches = async (content) => {
|
|
|
394
394
|
// Exported method only accepts markdown, also filters out dupes and matches to ensure slugs exist
|
|
395
395
|
let { matches } = await getMatches(content, true);
|
|
396
396
|
matches = await filterMatches(matches);
|
|
397
|
-
const ids = await
|
|
397
|
+
const ids = await User.getUidsByUserslugs(matches.map(match => match.slice(1).toLowerCase()));
|
|
398
398
|
matches = matches.map((slug, idx) => (ids[idx] ? {
|
|
399
399
|
id: ids[idx],
|
|
400
400
|
slug,
|
|
@@ -405,7 +405,7 @@ Mentions.getMatches = async (content) => {
|
|
|
405
405
|
|
|
406
406
|
async function filterMatches(matches) {
|
|
407
407
|
matches = Array.from(new Set(matches));
|
|
408
|
-
const exists = await
|
|
408
|
+
const exists = await meta.userOrGroupExists(matches.map(match => match.slice(1)));
|
|
409
409
|
|
|
410
410
|
return matches.filter((m, i) => exists[[i]]);
|
|
411
411
|
}
|
|
@@ -502,20 +502,25 @@ Mentions.parseRaw = async (content, type = 'default') => {
|
|
|
502
502
|
}
|
|
503
503
|
}));
|
|
504
504
|
|
|
505
|
-
|
|
505
|
+
let parsed = splitContent.join('');
|
|
506
|
+
|
|
507
|
+
// Early return if no urls to modify
|
|
508
|
+
if (!urlMap.size) {
|
|
509
|
+
return parsed;
|
|
510
|
+
}
|
|
506
511
|
|
|
507
512
|
// Modify existing anchors to local profile
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
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);
|
|
516
521
|
});
|
|
517
522
|
|
|
518
|
-
return
|
|
523
|
+
return parsed;
|
|
519
524
|
};
|
|
520
525
|
|
|
521
526
|
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.3",
|
|
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": {
|
|
@@ -22,16 +22,14 @@
|
|
|
22
22
|
"compatibility": "^4.0.0"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"cheerio": "^1.0.0-rc.12",
|
|
26
25
|
"html-entities": "^2.3.2",
|
|
27
26
|
"lodash": "4.17.21",
|
|
28
|
-
"sanitize-html": "^2.13.0",
|
|
29
27
|
"validator": "^13.0.0"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
|
-
"
|
|
33
|
-
"eslint": "9.3.0",
|
|
30
|
+
"eslint": "^9.0.0",
|
|
34
31
|
"eslint-config-nodebb": "0.2.1",
|
|
35
|
-
"eslint-plugin-import": "2.29.1"
|
|
32
|
+
"eslint-plugin-import": "2.29.1",
|
|
33
|
+
"mocha": "10.4.0"
|
|
36
34
|
}
|
|
37
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
|
+
}
|