Changeset 6111 for SRUAggregator
- Timestamp:
- 03/17/15 14:26:34 (9 years ago)
- Location:
- SRUAggregator/trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/pom.xml
r6097 r6111 8 8 <groupId>eu.clarin.sru.fcs</groupId> 9 9 <artifactId>Aggregator2</artifactId> 10 <version>2.0.0-beta- 29</version>10 <version>2.0.0-beta-30</version> 11 11 <name>FCS Aggregator</name> 12 12 -
SRUAggregator/trunk/src/main/resources/assets/js/main.js
r6093 r6111 3 3 "use strict"; 4 4 5 var VERSION = "VERSION 2.0.0-beta-28";6 var URLROOT = "/Aggregator-testing";5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-30"; 6 var URLROOT = window.MyAggregator.URLROOT = "/Aggregator-testing"; 7 7 8 8 var PT = React.PropTypes; … … 71 71 72 72 renderAggregator: function() { 73 return React.createElement(AggregatorPage, {ajax: this.ajax , corpora: this.state.corpora, languageMap: this.state.languageMap});73 return React.createElement(AggregatorPage, {ajax: this.ajax}); 74 74 }, 75 75 … … 84 84 renderStatistics: function() { 85 85 return React.createElement(StatisticsPage, {ajax: this.ajax}); 86 }, 87 88 renderEmbedded: function() { 89 return React.createElement(AggregatorPage, {ajax: this.ajax, embedded: true}); 86 90 }, 87 91 … … 92 96 'about': this.renderAbout, 93 97 'stats': this.renderStatistics, 98 'embed': this.renderEmbedded, 94 99 }; 95 100 }, … … 110 115 toAbout: function(doPushHistory) { this.gotoPage(doPushHistory, 'about'); }, 111 116 toStatistics: function(doPushHistory) { this.gotoPage(doPushHistory, 'stats'); }, 117 toEmbedded: function(doPushHistory) { this.gotoPage(doPushHistory, 'embed'); }, 112 118 113 119 renderCollapsible: function() { … … 132 138 }, 133 139 134 render: function() { 140 renderTop: function() { 141 if (this.state.navbarPageFn === this.renderEmbedded) { 142 return false; 143 } 135 144 return ( 136 145 React.createElement("div", null, … … 156 165 ), 157 166 158 React.createElement(ErrorPane, {errorMessages: this.state.errorMessages}), 167 React.createElement(ErrorPane, {errorMessages: this.state.errorMessages}) 168 ) 169 ); 170 }, 171 172 render: function() { 173 return ( 174 React.createElement("div", null, 175 React.createElement("div", null, " ", this.renderTop(), " "), 159 176 160 177 React.createElement("div", {id: "push"}, … … 481 498 482 499 render: function() { 500 var path = window.location.pathname.split('/'); 501 if (path.length === 3 && path[2] === 'embed') { 502 return false; 503 } 483 504 return ( 484 505 React.createElement("div", {className: "container"}, … … 521 542 } else if (p === 'stats') { 522 543 this.toStatistics(false); 544 } else if (p === 'embed') { 545 this.toEmbedded(false); 523 546 } else { 524 547 this.toAggregator(false); -
SRUAggregator/trunk/src/main/resources/assets/js/main.jsx
r6097 r6111 3 3 "use strict"; 4 4 5 var VERSION = "VERSION 2.0.0-beta-29";6 var URLROOT = "/Aggregator-testing";5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-30"; 6 var URLROOT = window.MyAggregator.URLROOT = "/Aggregator-testing"; 7 7 8 8 var PT = React.PropTypes; … … 71 71 72 72 renderAggregator: function() { 73 return <AggregatorPage ajax={this.ajax} corpora={this.state.corpora} languageMap={this.state.languageMap}/>;73 return <AggregatorPage ajax={this.ajax} />; 74 74 }, 75 75 … … 84 84 renderStatistics: function() { 85 85 return <StatisticsPage ajax={this.ajax} />; 86 }, 87 88 renderEmbedded: function() { 89 return <AggregatorPage ajax={this.ajax} embedded={true}/>; 86 90 }, 87 91 … … 92 96 'about': this.renderAbout, 93 97 'stats': this.renderStatistics, 98 'embed': this.renderEmbedded, 94 99 }; 95 100 }, … … 110 115 toAbout: function(doPushHistory) { this.gotoPage(doPushHistory, 'about'); }, 111 116 toStatistics: function(doPushHistory) { this.gotoPage(doPushHistory, 'stats'); }, 117 toEmbedded: function(doPushHistory) { this.gotoPage(doPushHistory, 'embed'); }, 112 118 113 119 renderCollapsible: function() { … … 132 138 }, 133 139 134 render: function() { 140 renderTop: function() { 141 if (this.state.navbarPageFn === this.renderEmbedded) { 142 return false; 143 } 135 144 return ( 136 145 <div> … … 157 166 158 167 <ErrorPane errorMessages={this.state.errorMessages} /> 168 </div> 169 ); 170 }, 171 172 render: function() { 173 return ( 174 <div> 175 <div> { this.renderTop() } </div> 159 176 160 177 <div id="push"> … … 481 498 482 499 render: function() { 500 var path = window.location.pathname.split('/'); 501 if (path.length === 3 && path[2] === 'embed') { 502 return false; 503 } 483 504 return ( 484 505 <div className="container"> … … 521 542 } else if (p === 'stats') { 522 543 this.toStatistics(false); 544 } else if (p === 'embed') { 545 this.toEmbedded(false); 523 546 } else { 524 547 this.toAggregator(false); -
SRUAggregator/trunk/src/main/resources/assets/js/search.js
r6097 r6111 175 175 var AggregatorPage = window.MyAggregator.AggregatorPage = React.createClass({displayName: 'AggregatorPage', 176 176 propTypes: { 177 ajax: PT.func.isRequired 177 ajax: PT.func.isRequired, 178 embedded: PT.bool, 178 179 }, 179 180 … … 223 224 search: function() { 224 225 var query = this.state.query; 225 if (!query ) {226 if (!query || this.props.embedded) { 226 227 this.setState({ hits: this.nohits, searchId: null }); 227 228 return; … … 429 430 }, 430 431 432 renderSearchButtonOrLink: function() { 433 if (this.props.embedded) { 434 var query = this.state.query; 435 var newurl = query ? (window.MyAggregator.URLROOT + "?search=" + query) : "#"; 436 return ( 437 React.createElement("a", {className: "btn btn-default input-lg", type: "button", target: "_blank", href: newurl}, 438 React.createElement("i", {className: "glyphicon glyphicon-search"}) 439 ) 440 ); 441 } 442 return ( 443 React.createElement("button", {className: "btn btn-default input-lg", type: "button", onClick: this.search}, 444 React.createElement("i", {className: "glyphicon glyphicon-search"}) 445 ) 446 ); 447 }, 448 431 449 render: function() { 432 450 var layer = layerMap[this.state.searchLayerId]; … … 444 462 tabIndex: "1", onChange: this.onQuery, onKeyDown: this.handleKey}), 445 463 React.createElement("div", {className: "input-group-btn"}, 446 React.createElement("button", {className: "btn btn-default input-lg", type: "button", onClick: this.search}, 447 React.createElement("i", {className: "glyphicon glyphicon-search"}) 448 ) 464 this.renderSearchButtonOrLink() 449 465 ) 450 466 ) … … 486 502 ), 487 503 504 this.props.embedded ? false : 488 505 React.createElement("div", {className: "input-group"}, 489 506 React.createElement("span", {className: "input-group-addon nobkg"}, "in"), … … 491 508 this.state.corpora.getSelectedMessage(), " ", React.createElement("span", {className: "caret"}) 492 509 ) 493 ), 494 510 ), 511 512 this.props.embedded ? false : 495 513 React.createElement("div", {className: "input-group"}, 496 514 React.createElement("span", {className: "input-group-addon nobkg"}, "and show up to"), -
SRUAggregator/trunk/src/main/resources/assets/js/search.jsx
r6097 r6111 175 175 var AggregatorPage = window.MyAggregator.AggregatorPage = React.createClass({ 176 176 propTypes: { 177 ajax: PT.func.isRequired 177 ajax: PT.func.isRequired, 178 embedded: PT.bool, 178 179 }, 179 180 … … 223 224 search: function() { 224 225 var query = this.state.query; 225 if (!query ) {226 if (!query || this.props.embedded) { 226 227 this.setState({ hits: this.nohits, searchId: null }); 227 228 return; … … 429 430 }, 430 431 432 renderSearchButtonOrLink: function() { 433 if (this.props.embedded) { 434 var query = this.state.query; 435 var newurl = query ? (window.MyAggregator.URLROOT + "?search=" + query) : "#"; 436 return ( 437 <a className="btn btn-default input-lg" type="button" target="_blank" href={newurl}> 438 <i className="glyphicon glyphicon-search"></i> 439 </a> 440 ); 441 } 442 return ( 443 <button className="btn btn-default input-lg" type="button" onClick={this.search}> 444 <i className="glyphicon glyphicon-search"></i> 445 </button> 446 ); 447 }, 448 431 449 render: function() { 432 450 var layer = layerMap[this.state.searchLayerId]; … … 444 462 tabIndex="1" onChange={this.onQuery} onKeyDown={this.handleKey} /> 445 463 <div className="input-group-btn"> 446 <button className="btn btn-default input-lg" type="button" onClick={this.search}> 447 <i className="glyphicon glyphicon-search"></i> 448 </button> 464 {this.renderSearchButtonOrLink()} 449 465 </div> 450 466 </div> … … 486 502 </div> 487 503 504 { this.props.embedded ? false : 488 505 <div className="input-group"> 489 506 <span className="input-group-addon nobkg">in</span> … … 491 508 {this.state.corpora.getSelectedMessage()} <span className="caret"/> 492 509 </button> 493 </div> 494 510 </div> } 511 512 { this.props.embedded ? false : 495 513 <div className="input-group"> 496 514 <span className="input-group-addon nobkg">and show up to</span> … … 502 520 </div> 503 521 <span className="input-group-addon nobkg">hits</span> 504 </div> 522 </div> } 505 523 </form> 506 524 </div>
Note: See TracChangeset
for help on using the changeset viewer.