Ignore:
Timestamp:
02/24/15 16:58:55 (9 years ago)
Author:
emanuel.dima@uni-tuebingen.de
Message:
  1. alpha 21: downloading as text, csv, excel and tcf works
File:
1 edited

Legend:

Unmodified
Added
Removed
  • SRUAggregator/trunk/src/main/resources/assets/js/corpora.js

    r5959 r6043  
    1212
    1313/////////////////////////////////
    14 
    15 var SearchCorpusBox = React.createClass({displayName: 'SearchCorpusBox',
    16         propTypes: {
    17                 search: PT.func.isRequired,
    18         },
    19 
    20         getInitialState: function () {
    21                 return {
    22                         query: ""
    23                 };
    24         },
    25 
    26         handleChange: function(event) {
    27                 var query = event.target.value;
    28                 this.setState({query: query});
    29 
    30                 if (query.length === 0 || 2 <= query.length) {
    31                         this.props.search(query);
    32                 }
    33                 event.stopPropagation();
    34         },
    35 
    36         handleKey: function(event) {
    37                 if (event.keyCode==13) {
    38                         this.props.search(event.target.value);
    39                 }
    40         },
    41 
    42         render: function() {
    43                 return  React.createElement("div", {className: "form-group"},
    44                                         React.createElement("input", {className: "form-control search search-collection", type: "text",
    45                                                 value: this.state.query, placeholder: "Search for collection",
    46                                                 onChange: this.handleChange})
    47                                 );
    48         }
    49 });
    5014
    5115var CorpusView = window.MyAggregator.CorpusView = React.createClass({displayName: 'CorpusView',
     
    281245});
    282246
     247var SearchCorpusBox = React.createClass({displayName: 'SearchCorpusBox',
     248        propTypes: {
     249                search: PT.func.isRequired,
     250        },
     251
     252        getInitialState: function () {
     253                return {
     254                        query: ""
     255                };
     256        },
     257
     258        handleChange: function(event) {
     259                var query = event.target.value;
     260                this.setState({query: query});
     261
     262                if (query.length === 0 || 2 <= query.length) {
     263                        this.props.search(query);
     264                }
     265                event.stopPropagation();
     266        },
     267
     268        handleKey: function(event) {
     269                if (event.keyCode==13) {
     270                        this.props.search(event.target.value);
     271                }
     272        },
     273
     274        render: function() {
     275                return  React.createElement("div", {className: "form-group"},
     276                                        React.createElement("input", {className: "form-control search search-collection", type: "text",
     277                                                value: this.state.query, placeholder: "Search for collection",
     278                                                onChange: this.handleChange})
     279                                );
     280        }
     281});
     282
    283283})();
Note: See TracChangeset for help on using the changeset viewer.