Changeset 6145 for SRUAggregator
- Timestamp:
- 04/15/15 10:35:11 (9 years ago)
- Location:
- SRUAggregator/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUAggregator/trunk/pom.xml
r6144 r6145 8 8 <groupId>eu.clarin.sru.fcs</groupId> 9 9 <artifactId>aggregator</artifactId> 10 <version>2.0.0-beta-3 5</version>10 <version>2.0.0-beta-36</version> 11 11 <name>FCS Aggregator</name> 12 12 -
SRUAggregator/trunk/src/main/java/eu/clarin/sru/fcs/aggregator/app/Aggregator.java
r6131 r6145 82 82 * TODO: test it in IE, other browsers 83 83 * 84 * TODO: tri-state for parent collections; search + message implications84 * TODO: expand parents of x-aggregator-context selected corpus 85 85 * 86 86 */ -
SRUAggregator/trunk/src/main/resources/assets/CLARIN.css
r5931 r6145 10 10 -webkit-font-smoothing: antialiased; 11 11 -moz-osx-font-smoothing: grayscale; 12 color: #222; 12 color: black; 13 /*color: #222;*/ 13 14 /*font-size: 12px;*/ 14 15 /*word-wrap: break-word;*/ -
SRUAggregator/trunk/src/main/resources/assets/clarinservices/clarinservices.css
r6144 r6145 1 1 #clarinservices button.dropdown-toggle { 2 2 background-color: transparent; 3 font-size:18px; 3 4 } 4 5 -
SRUAggregator/trunk/src/main/resources/assets/js/main.js
r6144 r6145 3 3 "use strict"; 4 4 5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-3 5";5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-36"; 6 6 7 7 var URLROOT = window.MyAggregator.URLROOT = … … 420 420 421 421 React.createElement("h3", null, "More help"), 422 React.createElement("p", null, "More detailed information on using FCS Aggregator is available at the ",422 React.createElement("p", null, "More detailed information on using FCS Aggregator is available at the  ", 423 423 React.createElement("a", {href: "http://weblicht.sfs.uni-tuebingen.de/weblichtwiki/index.php/FCS_Aggregator"}, 424 424 "Aggregator wiki page" … … 571 571 572 572 window.onpopstate = routeFromLocation.bind(main); 573 window.MyAggregator.main = main; 573 574 574 575 })(); -
SRUAggregator/trunk/src/main/resources/assets/js/main.jsx
r6144 r6145 3 3 "use strict"; 4 4 5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-3 5";5 var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-36"; 6 6 7 7 var URLROOT = window.MyAggregator.URLROOT = … … 141 141 <ul id="CLARIN_header_right" className="nav navbar-nav navbar-right"> 142 142 <li> 143 <div id="clarinservices" style={{padding: 10}}/>143 <div id="clarinservices" style={{padding:5}}/> 144 144 </li> 145 145 {this.renderLogin()} … … 420 420 421 421 <h3>More help</h3> 422 <p>More detailed information on using FCS Aggregator is available at the 422 <p>More detailed information on using FCS Aggregator is available at the 423 423 <a href="http://weblicht.sfs.uni-tuebingen.de/weblichtwiki/index.php/FCS_Aggregator"> 424 424 Aggregator wiki page … … 571 571 572 572 window.onpopstate = routeFromLocation.bind(main); 573 window.MyAggregator.main = main; 573 574 574 575 })(); -
SRUAggregator/trunk/src/main/resources/assets/js/search.js
r6132 r6145 42 42 var layerMap = { 43 43 text: layers[0], 44 sampa: layers[1], 44 sampa: layers[1], 45 45 }; 46 46 … … 60 60 var that = this; 61 61 this.corpora = corpora; 62 this.update = function() { 63 updateFn(that); 62 this.update = function() { 63 updateFn(that); 64 64 }; 65 65 66 66 var sortFn = function(x, y) { 67 67 var r = x.institution.name.localeCompare(y.institution.name); … … 69 69 return r; 70 70 } 71 return x.title.toLowerCase().localeCompare(y.title.toLowerCase()); 71 return x.title.toLowerCase().localeCompare(y.title.toLowerCase()); 72 72 }; 73 73 … … 79 79 corpus.selected = true; // selected in the corpus view 80 80 corpus.expanded = false; // not expanded in the corpus view 81 corpus.priority = 1; // used for ordering search results in corpus view 81 corpus.priority = 1; // used for ordering search results in corpus view 82 82 corpus.index = index; // original order, used for stable sort 83 83 }); … … 85 85 86 86 Corpora.prototype.recurseCorpus = function(corpus, fn) { 87 if (false === fn(corpus)) { 87 if (false === fn(corpus)) { 88 88 // no recursion 89 89 } else { … … 129 129 if (corpus.languages && corpus.languages.length === 1 && corpus.languages[0] === languageCode) { 130 130 return true; 131 } 131 } 132 132 133 133 // ? yes if the corpus also contains that language … … 152 152 153 153 Corpora.prototype.setAggregationContext = function(endpoints2handles) { 154 // console.log('setAggregationContext', endpoints2handles, this.corpora); 155 var recurseSelect = function(select, corpus) { 154 var selectSubTree = function(select, corpus) { 156 155 corpus.selected = false; 157 156 this.recurseCorpora(corpus.subCorpora, function(c) { c.selected = corpus.selected; }); 158 157 }; 159 158 160 this.corpora.forEach( recurseSelect.bind(this, false));159 this.corpora.forEach(selectSubTree.bind(this, false)); 161 160 162 161 var corporaToSelect = []; … … 173 172 }.bind(this)); 174 173 175 corporaToSelect.forEach( recurseSelect.bind(this, true));174 corporaToSelect.forEach(selectSubTree.bind(this, true)); 176 175 }; 177 176 … … 217 216 }, 218 217 219 nohits: { 218 nohits: { 220 219 results: null, 221 220 }, … … 247 246 if (this.isMounted()) { 248 247 var corpora = new Corpora(json.corpora, this.updateCorpora); 248 window.MyAggregator.corpora = json.corpora; 249 249 this.setState({ 250 250 corpora : corpora, … … 255 255 256 256 if (json['x-aggregation-context']) { 257 console.log("x-aggregation-context: ", json["x-aggregation-context"]);257 window.MyAggregator.xAggregationContext = json["x-aggregation-context"]; 258 258 corpora.setAggregationContext(json["x-aggregation-context"]); 259 259 if (!corpora.getSelectedIds().length) { … … 266 266 if (getQueryVariable('mode') === 'search' || 267 267 json.mode === 'search') { 268 window.MyAggregator.mode = 'search'; 268 269 this.search(); 269 270 } … … 281 282 if (!query || this.props.embedded) { 282 283 this.setState({ hits: this.nohits, searchId: null }); 283 return; 284 return; 284 285 } 285 286 var selectedIds = this.state.corpora.getSelectedIds(); … … 370 371 371 372 getDownloadLink: function(corpusId, format) { 372 return 'rest/search/'+this.state.searchId+'/download?' + 373 return 'rest/search/'+this.state.searchId+'/download?' + 373 374 this.getExportParams(corpusId, format); 374 375 }, 375 376 376 377 getToWeblichtLink: function(corpusId, forceLanguage) { 377 return 'rest/search/'+this.state.searchId+'/toWeblicht?' + 378 return 'rest/search/'+this.state.searchId+'/toWeblicht?' + 378 379 this.getExportParams(corpusId, null, forceLanguage); 379 380 }, 380 381 381 382 setLanguageAndFilter: function(languageObj, languageFilter) { 382 this.state.corpora.setVisibility(this.state.searchLayerId, 383 this.state.corpora.setVisibility(this.state.searchLayerId, 383 384 languageFilter === 'byGuess' ? multipleLanguageCode : languageObj[0]); 384 385 this.setState({ 385 language: languageObj, 386 languageFilter: languageFilter, 386 language: languageObj, 387 languageFilter: languageFilter, 387 388 corpora: this.state.corpora, // === this.state.corpora.update(); 388 389 }); … … 392 393 this.state.corpora.setVisibility(layerId, this.state.language[0]); 393 394 this.setState({ 394 searchLayerId: layerId, 395 hits: this.nohits, 395 searchLayerId: layerId, 396 hits: this.nohits, 396 397 searchId: null, 397 398 corpora: this.state.corpora, // === this.state.corpora.update(); … … 417 418 var results = null, inProgress = 0, hits = 0; 418 419 if (this.state.hits.results) { 419 results = this.state.hits.results.map(function(corpusHit) { 420 results = this.state.hits.results.map(function(corpusHit) { 420 421 return { 421 422 corpus: corpusHit.corpus, … … 425 426 kwics: noLangFiltering ? corpusHit.kwics : 426 427 corpusHit.kwics.filter(function(kwic) { 427 return kwic.language === langCode || 428 langCode === multipleLanguageCode || 429 langCode === null; 428 return kwic.language === langCode || 429 langCode === multipleLanguageCode || 430 langCode === null; 430 431 }), 431 432 }; … … 482 483 return React.createElement("h3", {style: {fontSize:'1em'}}, 483 484 corpus.title, 484 corpus.landingPage ? 485 corpus.landingPage ? 485 486 React.createElement("a", {href: corpus.landingPage, onClick: this.stop, style: {fontSize:12}}, 486 487 React.createElement("span", null, " â Homepage "), … … 504 505 React.createElement("button", {className: "btn btn-default input-lg", type: "button", onClick: this.search}, 505 506 React.createElement("i", {className: "glyphicon glyphicon-search"}) 506 ) 507 ) 507 508 ); 508 509 }, … … 534 535 535 536 React.createElement("div", {className: "input-group"}, 536 537 537 538 React.createElement("span", {className: "input-group-addon nobkg"}, "Search for"), 538 539 539 540 React.createElement("div", {className: "input-group-btn"}, 540 541 React.createElement("button", {className: "form-control btn btn-default", … … 547 548 React.createElement("div", {className: "input-group-btn"}, 548 549 React.createElement("ul", {ref: "layerDropdownMenu", className: "dropdown-menu"}, 549 layers.map(function(l) { 550 layers.map(function(l) { 550 551 var cls = l.disabled ? 'disabled':''; 551 552 var handler = function() { if (!l.disabled) this.setLayer(l.id); }.bind(this); … … 554 555 }.bind(this)) 555 556 556 ), 557 ), 557 558 React.createElement("button", {className: "form-control btn btn-default", 558 559 'aria-expanded': "false", 'data-toggle': "dropdown"}, … … 563 564 ), 564 565 565 this.props.embedded ? false : 566 this.props.embedded ? false : 566 567 React.createElement("div", {className: "input-group"}, 567 568 React.createElement("span", {className: "input-group-addon nobkg"}, "in"), … … 571 572 ), 572 573 573 this.props.embedded ? false : 574 this.props.embedded ? false : 574 575 React.createElement("div", {className: "input-group"}, 575 576 React.createElement("span", {className: "input-group-addon nobkg"}, "and show up to"), … … 654 655 655 656 renderRadio: function(option) { 656 return this.props.languageFilter === option ? 657 return this.props.languageFilter === option ? 657 658 React.createElement("input", {type: "radio", name: "filterOpts", value: option, checked: true, onChange: this.setFilter.bind(this, option)}) 658 659 : React.createElement("input", {type: "radio", name: "filterOpts", value: option, onChange: this.setFilter.bind(this, option)}); … … 681 682 React.createElement("label", {style: {color:'black'}}, 682 683 this.renderRadio('byMeta'), " ", 683 "Use the collections", "'", " specified language to filter results" 684 "Use the collections", "'", " specified language to filter results" 684 685 ) 685 686 ), … … 687 688 React.createElement("label", {style: {color:'black'}}, 688 689 this.renderRadio('byGuess'), " ", 689 "Filter results by using a language detector" 690 "Filter results by using a language detector" 690 691 ) 691 692 ), … … 708 709 // return {hasPopover: true}; 709 710 // }, 710 711 711 712 getInitialState: function () { 712 return { 713 return { 713 714 displayKwic: false, 714 715 }; … … 758 759 return React.createElement("div", {className: "alert alert-warning", key: key}, 759 760 React.createElement("div", null, "Diagnostic: ", d.message) 760 ); 761 ); 761 762 }, 762 763 … … 803 804 return React.createElement("div", {className: "inline btn-group", style: {display:"inline-block"}}, 804 805 React.createElement("label", {forHtml: "inputKwic", className: "btn btn-flat"}, 805 this.state.displayKwic ? 806 this.state.displayKwic ? 806 807 React.createElement("input", {id: "inputKwic", type: "checkbox", value: "kwic", checked: true, onChange: this.toggleKwic}) : 807 808 React.createElement("input", {id: "inputKwic", type: "checkbox", value: "kwic", onChange: this.toggleKwic}), … … 845 846 React.createElement("ul", {className: "dropdown-menu"}, 846 847 React.createElement("li", null, 847 error ? 848 error ? 848 849 React.createElement("div", {className: "alert alert-danger", style: {margin:10, width:200}}, error) : 849 850 React.createElement("a", {href: this.props.getToWeblichtLink(corpusId, forceLanguage), target: "_blank"}, " ", … … 893 894 894 895 renderMoreResults:function(){ 895 if (this.state.inProgress || this.props.corpusHit.inProgress) 896 if (this.state.inProgress || this.props.corpusHit.inProgress) 896 897 return React.createElement("span", {style: {fontStyle:'italic'}}, "Retrieving results, please wait..."); 897 898 … … 919 920 var forceLanguage = null, wlerror = null; 920 921 if (this.props.weblichtLanguages.indexOf(this.props.searchedLanguage[0]) < 0) { 921 // the search language is either AnyLanguage or unsupported 922 // the search language is either AnyLanguage or unsupported 922 923 if (this.props.searchedLanguage[0] === multipleLanguageCode) { 923 924 if (corpusHit.corpus.languages && corpusHit.corpus.languages.length === 1) { … … 930 931 } 931 932 } 932 } 933 } 933 934 if (!forceLanguage) { 934 935 wlerror = "Cannot use WebLicht: unsupported language ("+this.props.searchedLanguage[1]+")"; … … 940 941 React.createElement("div", {className: "corpusDescription"}, 941 942 React.createElement("p", null, React.createElement("i", {className: "fa fa-institution"}), " ", corpus.institution.name), 942 corpus.description ? 943 corpus.description ? 943 944 React.createElement("p", null, React.createElement("i", {className: "glyphicon glyphicon-info-sign"}), " ", corpus.description): false, 944 945 React.createElement("p", null, React.createElement("i", {className: "fa fa-language"}), " ", this.renderLanguages(corpus.languages)) … … 992 993 993 994 renderResultPanel: function(corpusHit) { 994 if (corpusHit.kwics.length === 0 && 995 if (corpusHit.kwics.length === 0 && 995 996 !corpusHit.exception && 996 997 corpusHit.diagnostics.length === 0) { … … 1012 1013 return React.createElement("div", {style: {marginTop:10}}, 1013 1014 React.createElement("div", null, msg), 1014 collhits.inProgress > 0 ? 1015 collhits.inProgress > 0 ? 1015 1016 React.createElement("div", {className: "progress", style: {marginBottom:10}}, 1016 1017 React.createElement("div", {className: "progress-bar progress-bar-striped active", role: "progressbar", … … 1021 1022 style: {width: '100%', backgroundColor:'#888'}}) 1022 1023 1023 ) : 1024 ) : 1024 1025 false 1025 1026 ); … … 1036 1037 showprogress ? this.renderProgressMessage() : React.createElement("div", {style: {height:20}}), 1037 1038 React.createElement("div", {style: {marginBottom:2}}, 1038 showprogress ? false : 1039 showprogress ? false : 1039 1040 React.createElement("div", {className: "float-left"}, " ", collhits.hits + " matching collections found", " "), 1040 1041 1041 collhits.hits === 0 ? false : 1042 collhits.hits === 0 ? false : 1042 1043 React.createElement("div", {className: "float-right"}, 1043 1044 React.createElement("div", null, 1044 1045 this.renderDisplayKWIC(), 1045 collhits.inProgress === 0 ? 1046 collhits.inProgress === 0 ? 1046 1047 React.createElement("div", {className: "inline"}, " ", this.renderDownloadLinks(), " ") 1047 1048 :false -
SRUAggregator/trunk/src/main/resources/assets/js/search.jsx
r6132 r6145 42 42 var layerMap = { 43 43 text: layers[0], 44 sampa: layers[1], 44 sampa: layers[1], 45 45 }; 46 46 … … 60 60 var that = this; 61 61 this.corpora = corpora; 62 this.update = function() { 63 updateFn(that); 62 this.update = function() { 63 updateFn(that); 64 64 }; 65 65 66 66 var sortFn = function(x, y) { 67 67 var r = x.institution.name.localeCompare(y.institution.name); … … 69 69 return r; 70 70 } 71 return x.title.toLowerCase().localeCompare(y.title.toLowerCase()); 71 return x.title.toLowerCase().localeCompare(y.title.toLowerCase()); 72 72 }; 73 73 … … 79 79 corpus.selected = true; // selected in the corpus view 80 80 corpus.expanded = false; // not expanded in the corpus view 81 corpus.priority = 1; // used for ordering search results in corpus view 81 corpus.priority = 1; // used for ordering search results in corpus view 82 82 corpus.index = index; // original order, used for stable sort 83 83 }); … … 85 85 86 86 Corpora.prototype.recurseCorpus = function(corpus, fn) { 87 if (false === fn(corpus)) { 87 if (false === fn(corpus)) { 88 88 // no recursion 89 89 } else { … … 129 129 if (corpus.languages && corpus.languages.length === 1 && corpus.languages[0] === languageCode) { 130 130 return true; 131 } 131 } 132 132 133 133 // ? yes if the corpus also contains that language … … 152 152 153 153 Corpora.prototype.setAggregationContext = function(endpoints2handles) { 154 // console.log('setAggregationContext', endpoints2handles, this.corpora); 155 var recurseSelect = function(select, corpus) { 154 var selectSubTree = function(select, corpus) { 156 155 corpus.selected = false; 157 156 this.recurseCorpora(corpus.subCorpora, function(c) { c.selected = corpus.selected; }); 158 157 }; 159 158 160 this.corpora.forEach( recurseSelect.bind(this, false));159 this.corpora.forEach(selectSubTree.bind(this, false)); 161 160 162 161 var corporaToSelect = []; … … 173 172 }.bind(this)); 174 173 175 corporaToSelect.forEach( recurseSelect.bind(this, true));174 corporaToSelect.forEach(selectSubTree.bind(this, true)); 176 175 }; 177 176 … … 217 216 }, 218 217 219 nohits: { 218 nohits: { 220 219 results: null, 221 220 }, … … 247 246 if (this.isMounted()) { 248 247 var corpora = new Corpora(json.corpora, this.updateCorpora); 248 window.MyAggregator.corpora = json.corpora; 249 249 this.setState({ 250 250 corpora : corpora, … … 255 255 256 256 if (json['x-aggregation-context']) { 257 console.log("x-aggregation-context: ", json["x-aggregation-context"]);257 window.MyAggregator.xAggregationContext = json["x-aggregation-context"]; 258 258 corpora.setAggregationContext(json["x-aggregation-context"]); 259 259 if (!corpora.getSelectedIds().length) { … … 266 266 if (getQueryVariable('mode') === 'search' || 267 267 json.mode === 'search') { 268 window.MyAggregator.mode = 'search'; 268 269 this.search(); 269 270 } … … 281 282 if (!query || this.props.embedded) { 282 283 this.setState({ hits: this.nohits, searchId: null }); 283 return; 284 return; 284 285 } 285 286 var selectedIds = this.state.corpora.getSelectedIds(); … … 370 371 371 372 getDownloadLink: function(corpusId, format) { 372 return 'rest/search/'+this.state.searchId+'/download?' + 373 return 'rest/search/'+this.state.searchId+'/download?' + 373 374 this.getExportParams(corpusId, format); 374 375 }, 375 376 376 377 getToWeblichtLink: function(corpusId, forceLanguage) { 377 return 'rest/search/'+this.state.searchId+'/toWeblicht?' + 378 return 'rest/search/'+this.state.searchId+'/toWeblicht?' + 378 379 this.getExportParams(corpusId, null, forceLanguage); 379 380 }, 380 381 381 382 setLanguageAndFilter: function(languageObj, languageFilter) { 382 this.state.corpora.setVisibility(this.state.searchLayerId, 383 this.state.corpora.setVisibility(this.state.searchLayerId, 383 384 languageFilter === 'byGuess' ? multipleLanguageCode : languageObj[0]); 384 385 this.setState({ 385 language: languageObj, 386 languageFilter: languageFilter, 386 language: languageObj, 387 languageFilter: languageFilter, 387 388 corpora: this.state.corpora, // === this.state.corpora.update(); 388 389 }); … … 392 393 this.state.corpora.setVisibility(layerId, this.state.language[0]); 393 394 this.setState({ 394 searchLayerId: layerId, 395 hits: this.nohits, 395 searchLayerId: layerId, 396 hits: this.nohits, 396 397 searchId: null, 397 398 corpora: this.state.corpora, // === this.state.corpora.update(); … … 417 418 var results = null, inProgress = 0, hits = 0; 418 419 if (this.state.hits.results) { 419 results = this.state.hits.results.map(function(corpusHit) { 420 results = this.state.hits.results.map(function(corpusHit) { 420 421 return { 421 422 corpus: corpusHit.corpus, … … 425 426 kwics: noLangFiltering ? corpusHit.kwics : 426 427 corpusHit.kwics.filter(function(kwic) { 427 return kwic.language === langCode || 428 langCode === multipleLanguageCode || 429 langCode === null; 428 return kwic.language === langCode || 429 langCode === multipleLanguageCode || 430 langCode === null; 430 431 }), 431 432 }; … … 480 481 if (!corpusHit) return <span/>; 481 482 var corpus = corpusHit.corpus; 482 return <h3 style={{fontSize:'1em'}}> 483 return <h3 style={{fontSize:'1em'}}> 483 484 {corpus.title} 484 { corpus.landingPage ? 485 { corpus.landingPage ? 485 486 <a href={corpus.landingPage} onClick={this.stop} style={{fontSize:12}}> 486 487 <span> â Homepage </span> … … 504 505 <button className="btn btn-default input-lg" type="button" onClick={this.search}> 505 506 <i className="glyphicon glyphicon-search"></i> 506 </button> 507 </button> 507 508 ); 508 509 }, … … 513 514 <div className="top-gap"> 514 515 <div className="row"> 515 <div className="aligncenter" style={{marginLeft:16, marginRight:16}}> 516 <div className="aligncenter" style={{marginLeft:16, marginRight:16}}> 516 517 <div className="input-group"> 517 518 <span className="input-group-addon" style={{backgroundColor:layer.searchLabelBkColor}}> … … 534 535 535 536 <div className="input-group"> 536 537 537 538 <span className="input-group-addon nobkg" >Search for</span> 538 539 539 540 <div className="input-group-btn"> 540 <button className="form-control btn btn-default" 541 <button className="form-control btn btn-default" 541 542 onClick={this.toggleLanguageSelection}> 542 543 {this.state.language[1]} <span className="caret"/> … … 547 548 <div className="input-group-btn"> 548 549 <ul ref="layerDropdownMenu" className="dropdown-menu"> 549 { layers.map(function(l) { 550 { layers.map(function(l) { 550 551 var cls = l.disabled ? 'disabled':''; 551 552 var handler = function() { if (!l.disabled) this.setLayer(l.id); }.bind(this); 552 return <li key={l.id} className={cls}> <a tabIndex="-1" href="#" 553 return <li key={l.id} className={cls}> <a tabIndex="-1" href="#" 553 554 onClick={handler}> {l.name} </a></li>; 554 555 }.bind(this)) 555 556 } 556 </ul> 557 <button className="form-control btn btn-default" 557 </ul> 558 <button className="form-control btn btn-default" 558 559 aria-expanded="false" data-toggle="dropdown" > 559 560 {layer.name} <span className="caret"/> … … 563 564 </div> 564 565 565 { this.props.embedded ? false : 566 { this.props.embedded ? false : 566 567 <div className="input-group"> 567 568 <span className="input-group-addon nobkg">in</span> … … 571 572 </div> } 572 573 573 { this.props.embedded ? false : 574 { this.props.embedded ? false : 574 575 <div className="input-group"> 575 576 <span className="input-group-addon nobkg">and show up to</span> … … 577 578 <input type="number" className="form-control input" min="10" max="250" 578 579 style={{width:60}} 579 onChange={this.setNumberOfResults} value={this.state.numberOfResults} 580 onChange={this.setNumberOfResults} value={this.state.numberOfResults} 580 581 onKeyPress={this.stop}/> 581 582 </div> … … 609 610 610 611 <div className="top-gap"> 611 <Results collhits={this.filterResults()} 612 <Results collhits={this.filterResults()} 612 613 toggleResultModal={this.toggleResultModal} 613 614 getDownloadLink={this.getDownloadLink} … … 654 655 655 656 renderRadio: function(option) { 656 return this.props.languageFilter === option ? 657 return this.props.languageFilter === option ? 657 658 <input type="radio" name="filterOpts" value={option} checked onChange={this.setFilter.bind(this, option)}/> 658 659 : <input type="radio" name="filterOpts" value={option} onChange={this.setFilter.bind(this, option)} />; … … 681 682 <label style={{color:'black'}}> 682 683 { this.renderRadio('byMeta') }{" "} 683 Use the collections{"'"} specified language to filter results 684 Use the collections{"'"} specified language to filter results 684 685 </label> 685 686 </div> … … 687 688 <label style={{color:'black'}}> 688 689 { this.renderRadio('byGuess') }{" "} 689 Filter results by using a language detector 690 Filter results by using a language detector 690 691 </label> 691 692 </div> … … 708 709 // return {hasPopover: true}; 709 710 // }, 710 711 711 712 getInitialState: function () { 712 return { 713 return { 713 714 displayKwic: false, 714 715 }; … … 756 757 return false; 757 758 } 758 return <div className="alert alert-warning" key={key}> 759 return <div className="alert alert-warning" key={key}> 759 760 <div>Diagnostic: {d.message}</div> 760 </div>; 761 </div>; 761 762 }, 762 763 … … 803 804 return <div className="inline btn-group" style={{display:"inline-block"}}> 804 805 <label forHtml="inputKwic" className="btn btn-flat"> 805 { this.state.displayKwic ? 806 { this.state.displayKwic ? 806 807 <input id="inputKwic" type="checkbox" value="kwic" checked onChange={this.toggleKwic} /> : 807 808 <input id="inputKwic" type="checkbox" value="kwic" onChange={this.toggleKwic} /> … … 818 819 <button className="btn btn-flat" aria-expanded="false" data-toggle="dropdown"> 819 820 <span className="glyphicon glyphicon-download-alt" aria-hidden="true"/> 820 {" "} Download {" "} 821 {" "} Download {" "} 821 822 <span className="caret"/> 822 823 </button> … … 840 841 <button className="btn btn-flat" aria-expanded="false" data-toggle="dropdown"> 841 842 <span className="glyphicon glyphicon-export" aria-hidden="true"/> 842 {" "} Use Weblicht {" "} 843 {" "} Use Weblicht {" "} 843 844 <span className="caret"/> 844 845 </button> 845 846 <ul className="dropdown-menu"> 846 <li> 847 {error ? 847 <li> 848 {error ? 848 849 <div className="alert alert-danger" style={{margin:10, width:200}}>{error}</div> : 849 <a href={this.props.getToWeblichtLink(corpusId, forceLanguage)} target="_blank">{" "} 850 <a href={this.props.getToWeblichtLink(corpusId, forceLanguage)} target="_blank">{" "} 850 851 Send to Weblicht</a> 851 852 } … … 893 894 894 895 renderMoreResults:function(){ 895 if (this.state.inProgress || this.props.corpusHit.inProgress) 896 if (this.state.inProgress || this.props.corpusHit.inProgress) 896 897 return <span style={{fontStyle:'italic'}}>Retrieving results, please wait...</span>; 897 898 … … 919 920 var forceLanguage = null, wlerror = null; 920 921 if (this.props.weblichtLanguages.indexOf(this.props.searchedLanguage[0]) < 0) { 921 // the search language is either AnyLanguage or unsupported 922 // the search language is either AnyLanguage or unsupported 922 923 if (this.props.searchedLanguage[0] === multipleLanguageCode) { 923 924 if (corpusHit.corpus.languages && corpusHit.corpus.languages.length === 1) { … … 930 931 } 931 932 } 932 } 933 } 933 934 if (!forceLanguage) { 934 935 wlerror = "Cannot use WebLicht: unsupported language ("+this.props.searchedLanguage[1]+")"; … … 936 937 } 937 938 var corpus = corpusHit.corpus; 938 return <div> 939 return <div> 939 940 <ReactCSSTransitionGroup transitionName="fade"> 940 941 <div className='corpusDescription'> 941 942 <p><i className="fa fa-institution"/> {corpus.institution.name}</p> 942 {corpus.description ? 943 {corpus.description ? 943 944 <p><i className="glyphicon glyphicon-info-sign"/> {corpus.description}</p>: false} 944 945 <p><i className="fa fa-language"/> {this.renderLanguages(corpus.languages)}</p> … … 992 993 993 994 renderResultPanel: function(corpusHit) { 994 if (corpusHit.kwics.length === 0 && 995 if (corpusHit.kwics.length === 0 && 995 996 !corpusHit.exception && 996 997 corpusHit.diagnostics.length === 0) { 997 998 return false; 998 999 } 999 return <Panel key={corpusHit.corpus.id} 1000 title={this.renderPanelTitle(corpusHit.corpus)} 1000 return <Panel key={corpusHit.corpus.id} 1001 title={this.renderPanelTitle(corpusHit.corpus)} 1001 1002 info={this.renderPanelInfo(corpusHit)}> 1002 1003 {this.renderPanelBody(corpusHit)} … … 1012 1013 return <div style={{marginTop:10}}> 1013 1014 <div>{msg}</div> 1014 {collhits.inProgress > 0 ? 1015 {collhits.inProgress > 0 ? 1015 1016 <div className="progress" style={{marginBottom:10}}> 1016 <div className="progress-bar progress-bar-striped active" role="progressbar" 1017 <div className="progress-bar progress-bar-striped active" role="progressbar" 1017 1018 aria-valuenow={percents} aria-valuemin="0" aria-valuemax="100" style={styleperc} /> 1018 1019 {percents > 2 ? false : 1019 <div className="progress-bar progress-bar-striped active" role="progressbar" 1020 <div className="progress-bar progress-bar-striped active" role="progressbar" 1020 1021 aria-valuenow='100' aria-valuemin="0" aria-valuemax="100" 1021 1022 style={{width: '100%', backgroundColor:'#888'}} /> 1022 1023 } 1023 </div> : 1024 </div> : 1024 1025 false} 1025 1026 </div>; … … 1032 1033 } 1033 1034 var showprogress = collhits.inProgress > 0; 1034 return <div> 1035 return <div> 1035 1036 <ReactCSSTransitionGroup transitionName="fade"> 1036 1037 { showprogress ? this.renderProgressMessage() : <div style={{height:20}} />} 1037 1038 <div style={{marginBottom:2}}> 1038 { showprogress ? false : 1039 { showprogress ? false : 1039 1040 <div className="float-left"> {collhits.hits + " matching collections found"} </div> 1040 1041 } 1041 { collhits.hits === 0 ? false : 1042 { collhits.hits === 0 ? false : 1042 1043 <div className="float-right"> 1043 1044 <div> 1044 1045 { this.renderDisplayKWIC() } 1045 { collhits.inProgress === 0 ? 1046 { collhits.inProgress === 0 ? 1046 1047 <div className="inline"> {this.renderDownloadLinks()} </div> 1047 1048 :false
Note: See TracChangeset
for help on using the changeset viewer.