aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions/MenuActions.js
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-03 07:11:37 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-02-03 07:11:37 +0100
commitda929a367c3f1fe5f3546be82e47111c2fa84ad3 (patch)
tree89380f41b802256d8fdbf724e7d9e63b48209b4a /src/web/js/actions/MenuActions.js
parentMerge pull request #30 from jaesivsm/master (diff)
parentwriting a bit of doc, moving crawler together (diff)
downloadnewspipe-da929a367c3f1fe5f3546be82e47111c2fa84ad3.tar.gz
newspipe-da929a367c3f1fe5f3546be82e47111c2fa84ad3.tar.bz2
newspipe-da929a367c3f1fe5f3546be82e47111c2fa84ad3.zip
Merge pull request #31 from jaesivsm/master
redoing UI
Diffstat (limited to 'src/web/js/actions/MenuActions.js')
-rw-r--r--src/web/js/actions/MenuActions.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/web/js/actions/MenuActions.js b/src/web/js/actions/MenuActions.js
new file mode 100644
index 00000000..b9154581
--- /dev/null
+++ b/src/web/js/actions/MenuActions.js
@@ -0,0 +1,37 @@
+var JarrDispatcher = require('../dispatcher/JarrDispatcher');
+var ActionTypes = require('../constants/JarrConstants');
+var jquery = require('jquery');
+
+
+var MenuActions = {
+ // PARENT FILTERS
+ reload: function() {
+ jquery.getJSON('/menu', function(payload) {
+ JarrDispatcher.dispatch({
+ type: ActionTypes.RELOAD_MENU,
+ feeds: payload.feeds,
+ categories: payload.categories,
+ categories_order: payload.categories_order,
+ is_admin: payload.is_admin,
+ max_error: payload.max_error,
+ error_threshold: payload.error_threshold,
+ crawling_method: payload.crawling_method,
+ all_unread_count: payload.all_unread_count,
+ });
+ });
+ },
+ setFilter: function(filter) {
+ JarrDispatcher.dispatch({
+ type: ActionTypes.MENU_FILTER,
+ filter: filter,
+ });
+ },
+ toggleAllFolding: function(all_folded) {
+ JarrDispatcher.dispatch({
+ type: ActionTypes.TOGGLE_MENU_FOLD,
+ all_folded: all_folded,
+ });
+ },
+};
+
+module.exports = MenuActions;
bgstack15