- Timestamp:
- 01/26/15 15:12:46 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/src/main/resources/assets/js/search.jsx
r5931 r5954 65 65 corpus.expanded = false; // not expanded in the corpus view 66 66 corpus.priority = 1; // priority in corpus view 67 corpus.index = index; 67 corpus.index = index; // original order, used for stable sort 68 68 }); 69 69 } … … 79 79 Corpora.prototype.recurseCorpora = function(corpora, fn) { 80 80 var recfn = function(corpus, index){ 81 if (false === fn(corpus )) {81 if (false === fn(corpus, index)) { 82 82 // no recursion 83 83 } else { … … 284 284 285 285 stop: function(e) { 286 e.preventDefault();287 286 e.stopPropagation(); 288 287 }, … … 296 295 endRecord: corpusHit.endRecord, 297 296 exception: corpusHit.exception, 297 diagnostics: corpusHit.diagnostics, 298 298 searchString: corpusHit.searchString, 299 299 kwics: corpusHit.kwics.filter(function(kwic){ … … 379 379 <span className="input-group-addon nobkg">and show up to</span> 380 380 <div className="input-group-btn"> 381 <input type="number" className="form-control input" min="10" max="250" step="5"382 style={{width: 54}}381 <input type="number" className="form-control input" min="10" max="250" 382 style={{width:60}} 383 383 onChange={this.setNumberOfResults} value={this.state.numberOfResults} 384 384 onKeyPress={this.stop}/> … … 556 556 557 557 renderRowLanguage: function(hit) { 558 return <span style={{fontFace:"Courier",color:"black"}}>{hit.language} </span> ;558 return false; //<span style={{fontFace:"Courier",color:"black"}}>{hit.language} </span> ; 559 559 }, 560 560 … … 619 619 }, 620 620 621 renderDiagnostics: function(corpusHit) { 622 if (!corpusHit.diagnostics || corpusHit.diagnostics.length === 0) { 623 return false; 624 } 625 626 return corpusHit.diagnostics.map(function(d) { 627 return <div className="alert alert-danger" role="alert"> 628 {d.dgnMessage}{": "}{d.dgnDiagnostic} 629 </div>; 630 }); 631 }, 632 621 633 renderPanelBody: function(corpusHit) { 622 var fulllength = {width:"100%"}; 634 var fulllength = {width:"100%"}; 623 635 if (this.state.displayKwic) { 624 return <table className="table table-condensed table-hover" style={fulllength}> 625 <tbody>{corpusHit.kwics.map(this.renderRowsAsKwic)}</tbody> 626 </table>; 636 return <div> 637 {this.renderDiagnostics(corpusHit)} 638 <table className="table table-condensed table-hover" style={fulllength}> 639 <tbody>{corpusHit.kwics.map(this.renderRowsAsKwic)}</tbody> 640 </table> 641 </div>; 627 642 } else { 628 return <div>{corpusHit.kwics.map(this.renderRowsAsHits)}</div>; 643 return <div> 644 {this.renderDiagnostics(corpusHit)} 645 {corpusHit.kwics.map(this.renderRowsAsHits)} 646 </div>; 629 647 } 630 648 }, 631 649 632 650 renderResultPanels: function(corpusHit) { 633 if (corpusHit.kwics.length === 0) { 651 if (corpusHit.kwics.length === 0 && 652 corpusHit.diagnostics.length === 0) { 634 653 return false; 635 654 }
Note: See TracChangeset
for help on using the changeset viewer.