Add notification frequencies from nodebb-plugin-upvote-notifications. (#6640)

* Add notification frequencies from nodebb-plugin-upvote-notifications.

https://github.com/boomzillawtf/nodebb-plugin-upvote-notifications

* Fix editing settings clearing upvote notification preferences.
This commit is contained in:
Ben Lubar
2018-07-20 09:29:51 -05:00
committed by Barış Soner Uşaklı
parent 11258dac9c
commit f1a6537fc2
3 changed files with 11 additions and 1 deletions

View File

@@ -186,9 +186,15 @@ SocketHelpers.upvote = function (data, notification) {
all: function () {
return votes > 0;
},
first: function () {
return votes === 1;
},
everyTen: function () {
return votes > 0 && votes % 10 === 0;
},
threshold: function () {
return [1, 5, 10, 25].indexOf(votes) !== -1 || (votes >= 50 && votes % 50 === 0);
},
logarithmic: function () {
return votes > 1 && Math.log10(votes) % 1 === 0;
},