s/filter/search/

no matter what we agree on in #542,
this needs to be done anyway.
This commit is contained in:
Maximilian Hils 2015-03-30 00:46:33 +02:00
parent a32698fc04
commit 737002921e
4 changed files with 18 additions and 18 deletions

View File

@ -425,7 +425,7 @@ var FlowActions = {
}; };
var Query = { var Query = {
FILTER: "f", SEARCH: "s",
HIGHLIGHT: "h", HIGHLIGHT: "h",
SHOW_EVENTLOG: "e" SHOW_EVENTLOG: "e"
}; };
@ -2364,7 +2364,7 @@ var MainMenu = React.createClass({displayName: "MainMenu",
}, },
onFilterChange: function (val) { onFilterChange: function (val) {
var d = {}; var d = {};
d[Query.FILTER] = val; d[Query.SEARCH] = val;
this.setQuery(d); this.setQuery(d);
}, },
onHighlightChange: function (val) { onHighlightChange: function (val) {
@ -2376,7 +2376,7 @@ var MainMenu = React.createClass({displayName: "MainMenu",
actions.SettingsActions.update({intercept: val}); actions.SettingsActions.update({intercept: val});
}, },
render: function () { render: function () {
var filter = this.getQuery()[Query.FILTER] || ""; var search = this.getQuery()[Query.SEARCH] || "";
var highlight = this.getQuery()[Query.HIGHLIGHT] || ""; var highlight = this.getQuery()[Query.HIGHLIGHT] || "";
var intercept = this.state.settings.intercept || ""; var intercept = this.state.settings.intercept || "";
@ -2384,11 +2384,11 @@ var MainMenu = React.createClass({displayName: "MainMenu",
React.createElement("div", null, React.createElement("div", null,
React.createElement("div", {className: "menu-row"}, React.createElement("div", {className: "menu-row"},
React.createElement(FilterInput, { React.createElement(FilterInput, {
ref: "filter", ref: "search",
placeholder: "Filter", placeholder: "Search",
type: "filter", type: "search",
color: "black", color: "black",
value: filter, value: search,
onChange: this.onFilterChange}), onChange: this.onFilterChange}),
React.createElement(FilterInput, { React.createElement(FilterInput, {
ref: "highlight", ref: "highlight",
@ -2639,7 +2639,7 @@ var MainView = React.createClass({displayName: "MainView",
}, },
getViewFilt: function () { getViewFilt: function () {
try { try {
var filt = Filt.parse(this.getQuery()[Query.FILTER] || ""); var filt = Filt.parse(this.getQuery()[Query.SEARCH] || "");
var highlightStr = this.getQuery()[Query.HIGHLIGHT]; var highlightStr = this.getQuery()[Query.HIGHLIGHT];
var highlight = highlightStr ? Filt.parse(highlightStr) : false; var highlight = highlightStr ? Filt.parse(highlightStr) : false;
} catch (e) { } catch (e) {
@ -2655,7 +2655,7 @@ var MainView = React.createClass({displayName: "MainView",
}; };
}, },
componentWillReceiveProps: function (nextProps) { componentWillReceiveProps: function (nextProps) {
var filterChanged = (this.props.query[Query.FILTER] !== nextProps.query[Query.FILTER]); var filterChanged = (this.props.query[Query.SEARCH] !== nextProps.query[Query.SEARCH]);
var highlightChanged = (this.props.query[Query.HIGHLIGHT] !== nextProps.query[Query.HIGHLIGHT]); var highlightChanged = (this.props.query[Query.HIGHLIGHT] !== nextProps.query[Query.HIGHLIGHT]);
if (filterChanged || highlightChanged) { if (filterChanged || highlightChanged) {
this.state.view.recalculate(this.getViewFilt(), this.state.sortKeyFun); this.state.view.recalculate(this.getViewFilt(), this.state.sortKeyFun);

View File

@ -121,7 +121,7 @@ var FlowActions = {
}; };
var Query = { var Query = {
FILTER: "f", SEARCH: "s",
HIGHLIGHT: "h", HIGHLIGHT: "h",
SHOW_EVENTLOG: "e" SHOW_EVENTLOG: "e"
}; };

View File

@ -167,7 +167,7 @@ var MainMenu = React.createClass({
}, },
onFilterChange: function (val) { onFilterChange: function (val) {
var d = {}; var d = {};
d[Query.FILTER] = val; d[Query.SEARCH] = val;
this.setQuery(d); this.setQuery(d);
}, },
onHighlightChange: function (val) { onHighlightChange: function (val) {
@ -179,7 +179,7 @@ var MainMenu = React.createClass({
actions.SettingsActions.update({intercept: val}); actions.SettingsActions.update({intercept: val});
}, },
render: function () { render: function () {
var filter = this.getQuery()[Query.FILTER] || ""; var search = this.getQuery()[Query.SEARCH] || "";
var highlight = this.getQuery()[Query.HIGHLIGHT] || ""; var highlight = this.getQuery()[Query.HIGHLIGHT] || "";
var intercept = this.state.settings.intercept || ""; var intercept = this.state.settings.intercept || "";
@ -187,11 +187,11 @@ var MainMenu = React.createClass({
<div> <div>
<div className="menu-row"> <div className="menu-row">
<FilterInput <FilterInput
ref="filter" ref="search"
placeholder="Filter" placeholder="Search"
type="filter" type="search"
color="black" color="black"
value={filter} value={search}
onChange={this.onFilterChange} /> onChange={this.onFilterChange} />
<FilterInput <FilterInput
ref="highlight" ref="highlight"

View File

@ -41,7 +41,7 @@ var MainView = React.createClass({
}, },
getViewFilt: function () { getViewFilt: function () {
try { try {
var filt = Filt.parse(this.getQuery()[Query.FILTER] || ""); var filt = Filt.parse(this.getQuery()[Query.SEARCH] || "");
var highlightStr = this.getQuery()[Query.HIGHLIGHT]; var highlightStr = this.getQuery()[Query.HIGHLIGHT];
var highlight = highlightStr ? Filt.parse(highlightStr) : false; var highlight = highlightStr ? Filt.parse(highlightStr) : false;
} catch (e) { } catch (e) {
@ -57,7 +57,7 @@ var MainView = React.createClass({
}; };
}, },
componentWillReceiveProps: function (nextProps) { componentWillReceiveProps: function (nextProps) {
var filterChanged = (this.props.query[Query.FILTER] !== nextProps.query[Query.FILTER]); var filterChanged = (this.props.query[Query.SEARCH] !== nextProps.query[Query.SEARCH]);
var highlightChanged = (this.props.query[Query.HIGHLIGHT] !== nextProps.query[Query.HIGHLIGHT]); var highlightChanged = (this.props.query[Query.HIGHLIGHT] !== nextProps.query[Query.HIGHLIGHT]);
if (filterChanged || highlightChanged) { if (filterChanged || highlightChanged) {
this.state.view.recalculate(this.getViewFilt(), this.state.sortKeyFun); this.state.view.recalculate(this.getViewFilt(), this.state.sortKeyFun);