nodebb-plugin-mentions 4.0.5 → 4.0.6
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 +6 -6
- 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/he/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 +9 -7
- package/package.json +1 -1
- package/plugin.json +30 -30
- package/static/.eslintrc +3 -3
- package/test/{regex.js → index.js} +31 -7
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,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mentions": "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
|
-
"notificationType_mention": "When someone mentions you"
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"mentions": "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
|
+
"notificationType_mention": "When someone mentions you"
|
|
6
|
+
}
|
|
@@ -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> הזכיר אותך ב <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> 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
|
@@ -40,6 +40,7 @@ Mentions._defaults = {
|
|
|
40
40
|
overrideIgnores: 'off',
|
|
41
41
|
display: '',
|
|
42
42
|
};
|
|
43
|
+
Mentions._regex = regex;
|
|
43
44
|
|
|
44
45
|
SocketPlugins.mentions = {};
|
|
45
46
|
|
|
@@ -272,9 +273,9 @@ Mentions.parseRaw = async (content) => {
|
|
|
272
273
|
|
|
273
274
|
matches = _.uniq(matches).map((match) => {
|
|
274
275
|
/**
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
276
|
+
* Javascript-flavour of regex does not support lookaround,
|
|
277
|
+
* so need to clean up the cruft by discarding everthing
|
|
278
|
+
* before the @
|
|
278
279
|
*/
|
|
279
280
|
const atIndex = match.indexOf('@');
|
|
280
281
|
return atIndex !== 0 ? match.slice(atIndex) : match;
|
|
@@ -292,17 +293,18 @@ Mentions.parseRaw = async (content) => {
|
|
|
292
293
|
|
|
293
294
|
if (results.user.uid || results.groupExists) {
|
|
294
295
|
const regex = isLatinMention.test(match) ?
|
|
295
|
-
new RegExp(`(?:^|\\s
|
|
296
|
-
new RegExp(`(?:^|\\s
|
|
296
|
+
new RegExp(`(?:^|\\s|>|;)${match}((?=\\b)(?=[^-])|$)`, 'g') :
|
|
297
|
+
new RegExp(`(?:^|\\s|>|;)${match}`, 'g');
|
|
297
298
|
|
|
298
299
|
let skip = false;
|
|
299
300
|
|
|
300
301
|
splitContent = splitContent.map((c, i) => {
|
|
301
302
|
// *Might* not be needed anymore? Check pls...
|
|
302
303
|
if (skip || (i % 2) === 1) {
|
|
303
|
-
skip = c === '<code>';
|
|
304
|
+
skip = c === '<code>'; // if code block detected, skip the content inside of it
|
|
304
305
|
return c;
|
|
305
306
|
}
|
|
307
|
+
|
|
306
308
|
return c.replace(regex, (match) => {
|
|
307
309
|
// Again, cleaning up lookaround leftover bits
|
|
308
310
|
const atIndex = match.indexOf('@');
|
|
@@ -357,7 +359,7 @@ async function filterPrivilegedUids(uids, cid, toPid) {
|
|
|
357
359
|
|
|
358
360
|
const [isAdmin, isMod] = await Promise.all([
|
|
359
361
|
User.isAdministrator(uid),
|
|
360
|
-
User.isModerator(uid, cid),
|
|
362
|
+
User.isModerator(uid, cid), // covers gmod as well
|
|
361
363
|
]);
|
|
362
364
|
|
|
363
365
|
return isAdmin || isMod ? false : uid;
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
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": "filter:notifications.addFilters", "method": "addFilters" },
|
|
19
|
-
{ "hook": "filter:user.notificationTypes", "method": "notificationTypes" },
|
|
20
|
-
{ "hook": "filter:users.addFields", "method": "addFields" }
|
|
21
|
-
],
|
|
22
|
-
"scripts": [
|
|
23
|
-
"static/autofill.js"
|
|
24
|
-
],
|
|
25
|
-
"modules": {
|
|
26
|
-
"../admin/plugins/mentions.js": "./static/admin.js"
|
|
27
|
-
},
|
|
28
|
-
"languages": "languages",
|
|
29
|
-
"defaultLang": "en_GB",
|
|
30
|
-
"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": "filter:notifications.addFilters", "method": "addFilters" },
|
|
19
|
+
{ "hook": "filter:user.notificationTypes", "method": "notificationTypes" },
|
|
20
|
+
{ "hook": "filter:users.addFields", "method": "addFields" }
|
|
21
|
+
],
|
|
22
|
+
"scripts": [
|
|
23
|
+
"static/autofill.js"
|
|
24
|
+
],
|
|
25
|
+
"modules": {
|
|
26
|
+
"../admin/plugins/mentions.js": "./static/admin.js"
|
|
27
|
+
},
|
|
28
|
+
"languages": "languages",
|
|
29
|
+
"defaultLang": "en_GB",
|
|
30
|
+
"templates": "templates"
|
|
31
31
|
}
|
package/static/.eslintrc
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "nodebb/public"
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "nodebb/public"
|
|
3
|
+
}
|
|
@@ -3,15 +3,20 @@
|
|
|
3
3
|
/* globals describe, it, before */
|
|
4
4
|
|
|
5
5
|
const assert = require('assert');
|
|
6
|
-
const XRegExp = require('xregexp');
|
|
7
|
-
const regex = XRegExp('(?:^|\\s|\\>|;)(@[\\p{L}\\d\\-_.]+)', 'g');
|
|
8
6
|
|
|
9
|
-
const
|
|
7
|
+
const user = require.main.require('./src/user');
|
|
8
|
+
const utils = require.main.require('./src/utils');
|
|
9
|
+
|
|
10
|
+
const main = require('../library');
|
|
11
|
+
|
|
12
|
+
const regex = main._regex;
|
|
13
|
+
|
|
14
|
+
/* const db = */require.main.require('./test/mocks/databasemock');
|
|
10
15
|
|
|
11
16
|
// use core slugify module
|
|
12
17
|
const slugify = require.main.require('./src/slugify');
|
|
13
18
|
|
|
14
|
-
describe('regex',
|
|
19
|
+
describe('regex', () => {
|
|
15
20
|
const matcher = new RegExp(regex);
|
|
16
21
|
const strings = [
|
|
17
22
|
'@testUser',
|
|
@@ -23,9 +28,9 @@ describe('regex', function () {
|
|
|
23
28
|
'end of sentence. @testUser',
|
|
24
29
|
'@testUser.',
|
|
25
30
|
'@testUser\'s some text',
|
|
26
|
-
]
|
|
31
|
+
];
|
|
27
32
|
it('should match a mention in all strings', () => {
|
|
28
|
-
strings.forEach(string => {
|
|
33
|
+
strings.forEach((string) => {
|
|
29
34
|
const matches = string.match(matcher);
|
|
30
35
|
assert(matches);
|
|
31
36
|
assert.equal(slugify(matches[0]), 'testuser');
|
|
@@ -36,7 +41,7 @@ describe('regex', function () {
|
|
|
36
41
|
// TODO: Ideally the regex matcher should be its own utility function in `lib/`
|
|
37
42
|
});
|
|
38
43
|
|
|
39
|
-
describe('splitter',
|
|
44
|
+
describe('splitter', () => {
|
|
40
45
|
const utility = require('../lib/utility');
|
|
41
46
|
const testHTMLText = 'this is a post with <code>stuff in code</code> and a\n\n<blockquote>blockquote or two</blockquote>';
|
|
42
47
|
const testMdText = 'this is a post with `stuff in code` and a \n\n>blockquote or two';
|
|
@@ -144,3 +149,22 @@ describe('splitter', function () {
|
|
|
144
149
|
});
|
|
145
150
|
});
|
|
146
151
|
});
|
|
152
|
+
|
|
153
|
+
describe('parser', () => {
|
|
154
|
+
let slug;
|
|
155
|
+
|
|
156
|
+
before(async () => {
|
|
157
|
+
slug = utils.generateUUID().slice(0, 10);
|
|
158
|
+
await Promise.all([slug, `${slug}-two`].map(async (username) => {
|
|
159
|
+
await user.create({ username });
|
|
160
|
+
}));
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
it('should properly parse both users even if one user\'s username is a subset of the other', async () => {
|
|
164
|
+
const md = `This sentence contains two mentions: @${slug} and @${slug}-two`;
|
|
165
|
+
|
|
166
|
+
const html = await main.parseRaw(md);
|
|
167
|
+
|
|
168
|
+
assert.strictEqual(html, `This sentence contains two mentions: <a class="plugin-mentions-user plugin-mentions-a" href="http://127.0.0.1:4567/uid/1">@${slug}</a> and <a class="plugin-mentions-user plugin-mentions-a" href="http://127.0.0.1:4567/uid/2">@${slug}-two</a>`);
|
|
169
|
+
});
|
|
170
|
+
});
|