nodebb-plugin-cards
Advanced tools
Comparing version 0.2.3 to 0.3.0
{ | ||
"name": "nodebb-plugin-cards", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "NodeBB plugin that extends the mentions plugin with hover cards", | ||
@@ -26,4 +26,4 @@ "main": "library.js", | ||
"nbbpm": { | ||
"compatibility": "^0.9.0 || ^1.0.0" | ||
"compatibility": "^1.19.0" | ||
} | ||
} |
@@ -69,12 +69,12 @@ "use strict"; | ||
function toggleFollow($card, type, uid, username) { | ||
socket.emit('user.' + type, { | ||
uid: uid | ||
}, function(err) { | ||
if (err) { | ||
return app.alertError(err.message); | ||
} | ||
require(['api', 'alerts'], function (api, alerts) { | ||
api[type === 'follow' ? 'put' : 'del']('/users/' + uid + '/follow', undefined, function (err) { | ||
if (err) { | ||
return alerts.error(err); | ||
} | ||
$('[component="account/follow"]').toggleClass('hide', type === 'follow'); | ||
$('[component="account/unfollow"]').toggleClass('hide', type === 'unfollow'); | ||
app.alertSuccess('[[global:alert.' + type + ', ' + username + ']]'); | ||
$('[component="account/follow"]').toggleClass('hide', type === 'follow'); | ||
$('[component="account/unfollow"]').toggleClass('hide', type === 'unfollow'); | ||
alerts.success('[[global:alert.' + type + ', ' + username + ']]'); | ||
}); | ||
}); | ||
@@ -81,0 +81,0 @@ return false; |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
15751
1