aboutsummaryrefslogtreecommitdiff
path: root/src/web/js/actions/MiddlePanelActions.js
diff options
context:
space:
mode:
authorFrançois Schmidts <francois.schmidts@gmail.com>2015-10-12 22:36:01 +0200
committerFrançois Schmidts <francois.schmidts@gmail.com>2016-01-26 23:46:32 +0100
commit2c0e17cb977a1e8782799b337df8b1583d019906 (patch)
tree75563e440e9eac14950fa1a71a83e64df20e52d0 /src/web/js/actions/MiddlePanelActions.js
parentfixing sqlalchemy resolving warning (diff)
downloadnewspipe-2c0e17cb977a1e8782799b337df8b1583d019906.tar.gz
newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.tar.bz2
newspipe-2c0e17cb977a1e8782799b337df8b1583d019906.zip
bootstraping react
Diffstat (limited to 'src/web/js/actions/MiddlePanelActions.js')
-rw-r--r--src/web/js/actions/MiddlePanelActions.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/web/js/actions/MiddlePanelActions.js b/src/web/js/actions/MiddlePanelActions.js
new file mode 100644
index 00000000..9877d0d5
--- /dev/null
+++ b/src/web/js/actions/MiddlePanelActions.js
@@ -0,0 +1,54 @@
+var JarrDispatcher = require('../dispatcher/JarrDispatcher');
+var MiddlePanelActionTypes = require('../constants/JarrConstants').MiddlePanelActionTypes;
+
+
+var MiddlePanelActions = {
+ reload: function() {
+ $.getJSON('/middle_panel', function(payload) {
+ JarrDispatcher.dispatch({
+ type: MiddlePanelActionTypes.RELOAD_MIDDLE_PANEL,
+ articles: payload.articles,
+ });
+ });
+ },
+ removeParentFilter: function(parent_type, parent_id) {
+ JarrDispatcher.dispatch({
+ type: MiddlePanelActionTypes.MIDDLE_PANEL_PARENT_FILTER,
+ parent_type: null,
+ parent_id: null,
+ });
+ },
+ setCategoryFilter: function(category_id) {
+ JarrDispatcher.dispatch({
+ type: MiddlePanelActionTypes.MIDDLE_PANEL_PARENT_FILTER,
+ parent_type: 'category',
+ parent_id: category_id,
+ });
+ },
+ setFeedFilter: function(feed_id) {
+ JarrDispatcher.dispatch({
+ type: MiddlePanelActionTypes.MIDDLE_PANEL_PARENT_FILTER,
+ parent_type: 'feed',
+ parent_id: feed_id,
+ });
+ },
+ setFilterMiddlePanelAll: function() {
+ JarrDispatcher.dispatch({
+ component: 'middle_panel',
+ type: MiddlePanelActionTypes.MIDDLE_PANEL_FILTER_ALL,
+ });
+ },
+ setFilterMiddlePanelUnread: function() {
+ JarrDispatcher.dispatch({
+ component: 'middle_panel',
+ type: MiddlePanelActionTypes.MIDDLE_PANEL_FILTER_UNREAD,
+ });
+ },
+ setFilterMiddlePanelUnread: function() {
+ JarrDispatcher.dispatch({
+ type: MiddlePanelActionTypes.MIDDLE_PANEL_FILTER_LIKED,
+ });
+ },
+};
+
+module.exports = MiddlePanelActions;
bgstack15