From 54c5034ce07c477a4569d3c745497698561ed5fc Mon Sep 17 00:00:00 2001 From: psychobunny Date: Fri, 20 Feb 2015 12:31:38 -0500 Subject: [PATCH] moved rewards/conditions/conditoinals out of core into rewards-essentials --- src/rewards/admin.js | 85 ++------------------------------------------ 1 file changed, 3 insertions(+), 82 deletions(-) diff --git a/src/rewards/admin.js b/src/rewards/admin.js index 1f13ba7854..dd1acf6180 100644 --- a/src/rewards/admin.js +++ b/src/rewards/admin.js @@ -5,30 +5,6 @@ var rewards = {}, plugins = require('../plugins'), db = require('../database'); -var defaults = { - conditionals: [ - { - "name": ">", - "conditional": "greaterthan" - }, - { - "name": ">=", - "conditional": "greaterorequalthan" - }, - { - "name": "<", - "conditional": "lesserthan" - }, - { - "name": "<=", - "conditional": "lesserorequalthan" - }, - { - "name": "string:", - "conditional": "string" - } - ] -}; rewards.save = function(data, callback) { function save(data, next) { @@ -75,68 +51,13 @@ rewards.get = function(callback) { async.parallel({ active: getActiveRewards, conditions: function(next) { - plugins.fireHook('filter:rewards.conditions', [ - { - "name": "Reputation", - "condition": "core:user.reputation" - }, - { - "name": "Post Count", - "condition": "core:user.postcount" - }, - { - "name": "Last Logged in Time", - "condition": "core:user.lastonline" - } - ], next); + plugins.fireHook('filter:rewards.conditions', [], next); }, conditionals: function(next) { - plugins.fireHook('filter:rewards.conditionals', defaults.conditionals, next); + plugins.fireHook('filter:rewards.conditionals', [], next); }, rewards: function(next) { - plugins.fireHook('filter:rewards.rewards', [ - { - "rid": "core:add-to-group", - "name": "Add to Group", - "inputs": [ - { - "type": "select", - "name": "groupname", - "label": "Group Name:", - "values": [ - { - "name": "Group 1", - "value": "group1" - }, - { - "name": "Group 2", - "value": "group2" - }, - { - "name": "Group 3", - "value": "group3" - } - ], - } - ] - }, - { - "rid": "core:alert-user", - "name": "Send alert message", - "inputs": [ - { - "type": "text", - "name": "title", - "label": "Title:" - }, - { - "type": "text", - "name": "message", - "label": "Message:" - } - ] - } - ], next); + plugins.fireHook('filter:rewards.rewards', [], next); } }, callback); };