diff options
Diffstat (limited to 'src/web/js/components')
-rw-r--r-- | src/web/js/components/Menu.react.js | 17 | ||||
-rw-r--r-- | src/web/js/components/MiddlePanel.react.js | 8 | ||||
-rw-r--r-- | src/web/js/components/RightPanel.react.js | 11 |
3 files changed, 26 insertions, 10 deletions
diff --git a/src/web/js/components/Menu.react.js b/src/web/js/components/Menu.react.js index f4ad76d0..4537ee81 100644 --- a/src/web/js/components/Menu.react.js +++ b/src/web/js/components/Menu.react.js @@ -267,7 +267,22 @@ var Menu = React.createClass({ ); }, componentDidMount: function() { - MenuActions.reload(); + var setFilterFunc = null; + var id = null; + if(window.location.search.substring(1)) { + var args = window.location.search.substring(1).split('&'); + args.map(function(arg) { + if (arg.split('=')[0] == 'at' && arg.split('=')[1] == 'c') { + setFilterFunc = MiddlePanelActions.setCategoryFilter; + } else if (arg.split('=')[0] == 'at' && arg.split('=')[1] == 'f') { + setFilterFunc = MiddlePanelActions.setFeedFilter; + + } else if (arg.split('=')[0] == 'ai') { + id = parseInt(arg.split('=')[1]); + } + }); + } + MenuActions.reload(setFilterFunc, id); MenuStore.addChangeListener(this._onChange); }, componentWillUnmount: function() { diff --git a/src/web/js/components/MiddlePanel.react.js b/src/web/js/components/MiddlePanel.react.js index cb5be92d..561802aa 100644 --- a/src/web/js/components/MiddlePanel.react.js +++ b/src/web/js/components/MiddlePanel.react.js @@ -77,7 +77,7 @@ var TableLine = React.createClass({ evnt.stopPropagation(); }, loadArticle: function() { - this.setState({active: true, read: true}, function() { + this.setState({selected: true, read: true}, function() { RightPanelActions.loadArticle( this.props.article_id, this.props.read); }.bind(this)); @@ -228,7 +228,11 @@ var MiddlePanel = React.createClass({ return (<Row className="show-grid"> <div className="list-group"> {this.state.articles.map(function(article){ - return (<TableLine key={"a" + article.article_id} + var key = "a" + article.article_id; + if(article.read) {key+="r";} + if(article.liked) {key+="l";} + if(article.selected) {key+="s";} + return (<TableLine key={key} title={article.title} icon_url={article.icon_url} read={article.read} diff --git a/src/web/js/components/RightPanel.react.js b/src/web/js/components/RightPanel.react.js index 275bcfb3..f765607a 100644 --- a/src/web/js/components/RightPanel.react.js +++ b/src/web/js/components/RightPanel.react.js @@ -35,6 +35,7 @@ var PanelMixin = { </Button>); } btn_grp = (<ButtonGroup bsSize="small"> + {this.getExtraButton()} {edit_button} {rem_button} </ButtonGroup>); @@ -175,13 +176,7 @@ var Article = React.createClass({ <div id="article-content" dangerouslySetInnerHTML={ {__html: this.props.obj.content}} /> </div>); - }, - reloadParsed: function() { - if(this.props.obj.readability_available - && !this.props.obj.readability_parsed) { - RightPanelActions.loadArticle(this.props.obj.id, true, true); - } - }, + } }); var Feed = React.createClass({ @@ -198,6 +193,7 @@ var Feed = React.createClass({ {'title': 'Category', 'type': 'ignore', 'key': 'category_id'}, ], getTitle: function() {return this.props.obj.title;}, + getExtraButton: function() {return null;}, getFilterRow: function(i, filter) { return (<dd key={'d' + i + '-' + this.props.obj.id} className="input-group filter-row"> @@ -357,6 +353,7 @@ var Category = React.createClass({ if(this.props.obj.id != 0) {return true;} else {return false;} }, + getExtraButton: function () {return null;}, isRemovable: function() {return this.isEditable();}, obj_type: 'category', fields: [{'title': 'Category name', 'type': 'string', 'key': 'name'}], |