Index: SRUAggregator/trunk/pom.xml
===================================================================
--- SRUAggregator/trunk/pom.xml	(revision 6097)
+++ SRUAggregator/trunk/pom.xml	(revision 6111)
@@ -8,5 +8,5 @@
 	<groupId>eu.clarin.sru.fcs</groupId>
 	<artifactId>Aggregator2</artifactId>
-	<version>2.0.0-beta-29</version>
+	<version>2.0.0-beta-30</version>
 	<name>FCS Aggregator</name>
 
Index: SRUAggregator/trunk/src/main/resources/assets/js/main.js
===================================================================
--- SRUAggregator/trunk/src/main/resources/assets/js/main.js	(revision 6097)
+++ SRUAggregator/trunk/src/main/resources/assets/js/main.js	(revision 6111)
@@ -3,6 +3,6 @@
 "use strict";
 
-var VERSION = "VERSION 2.0.0-beta-28";
-var URLROOT = "/Aggregator-testing";
+var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-30";
+var URLROOT = window.MyAggregator.URLROOT = "/Aggregator-testing";
 
 var PT = React.PropTypes;
@@ -71,5 +71,5 @@
 
 	renderAggregator: function() {
-		return React.createElement(AggregatorPage, {ajax: this.ajax, corpora: this.state.corpora, languageMap: this.state.languageMap});
+		return React.createElement(AggregatorPage, {ajax: this.ajax});
 	},
 
@@ -84,4 +84,8 @@
 	renderStatistics: function() {
 		return React.createElement(StatisticsPage, {ajax: this.ajax});
+	},
+
+	renderEmbedded: function() {
+		return React.createElement(AggregatorPage, {ajax: this.ajax, embedded: true});
 	},
 
@@ -92,4 +96,5 @@
 			'about': this.renderAbout,
 			'stats': this.renderStatistics,
+			'embed': this.renderEmbedded,
 		};
 	},
@@ -110,4 +115,5 @@
 	toAbout: function(doPushHistory) { this.gotoPage(doPushHistory, 'about'); },
 	toStatistics: function(doPushHistory) { this.gotoPage(doPushHistory, 'stats'); },
+	toEmbedded: function(doPushHistory) { this.gotoPage(doPushHistory, 'embed'); },
 
 	renderCollapsible: function() {
@@ -132,5 +138,8 @@
 	},
 
-	render: function() {
+	renderTop: function() {
+		if (this.state.navbarPageFn === this.renderEmbedded) {
+			return false;
+		}
 		return	(
 			React.createElement("div", null, 
@@ -156,5 +165,13 @@
 				), 
 
-				React.createElement(ErrorPane, {errorMessages: this.state.errorMessages}), 
+				React.createElement(ErrorPane, {errorMessages: this.state.errorMessages})
+			)
+		);
+	},
+
+	render: function() {
+		return	(
+			React.createElement("div", null, 
+				React.createElement("div", null, " ",  this.renderTop(), " "), 
 
 				React.createElement("div", {id: "push"}, 
@@ -481,4 +498,8 @@
 
 	render: function() {
+		var path = window.location.pathname.split('/');
+		if (path.length === 3 && path[2] === 'embed') {
+			return false;
+		}
 		return	(
 			React.createElement("div", {className: "container"}, 
@@ -521,4 +542,6 @@
 		} else if (p === 'stats') {
 			this.toStatistics(false);
+		} else if (p === 'embed') {
+			this.toEmbedded(false);
 		} else {
 			this.toAggregator(false);
Index: SRUAggregator/trunk/src/main/resources/assets/js/main.jsx
===================================================================
--- SRUAggregator/trunk/src/main/resources/assets/js/main.jsx	(revision 6097)
+++ SRUAggregator/trunk/src/main/resources/assets/js/main.jsx	(revision 6111)
@@ -3,6 +3,6 @@
 "use strict";
 
-var VERSION = "VERSION 2.0.0-beta-29";
-var URLROOT = "/Aggregator-testing";
+var VERSION = window.MyAggregator.VERSION = "VERSION 2.0.0-beta-30";
+var URLROOT = window.MyAggregator.URLROOT = "/Aggregator-testing";
 
 var PT = React.PropTypes;
@@ -71,5 +71,5 @@
 
 	renderAggregator: function() {
-		return <AggregatorPage ajax={this.ajax} corpora={this.state.corpora} languageMap={this.state.languageMap} />;
+		return <AggregatorPage ajax={this.ajax} />;
 	},
 
@@ -84,4 +84,8 @@
 	renderStatistics: function() {
 		return <StatisticsPage ajax={this.ajax} />;
+	},
+
+	renderEmbedded: function() {
+		return <AggregatorPage ajax={this.ajax} embedded={true}/>;
 	},
 
@@ -92,4 +96,5 @@
 			'about': this.renderAbout,
 			'stats': this.renderStatistics,
+			'embed': this.renderEmbedded,
 		};
 	},
@@ -110,4 +115,5 @@
 	toAbout: function(doPushHistory) { this.gotoPage(doPushHistory, 'about'); },
 	toStatistics: function(doPushHistory) { this.gotoPage(doPushHistory, 'stats'); },
+	toEmbedded: function(doPushHistory) { this.gotoPage(doPushHistory, 'embed'); },
 
 	renderCollapsible: function() {
@@ -132,5 +138,8 @@
 	},
 
-	render: function() {
+	renderTop: function() {
+		if (this.state.navbarPageFn === this.renderEmbedded) {
+			return false;
+		}
 		return	(
 			<div>
@@ -157,4 +166,12 @@
 
 				<ErrorPane errorMessages={this.state.errorMessages} />
+			</div>
+		);
+	},
+
+	render: function() {
+		return	(
+			<div>
+				<div> { this.renderTop() } </div>
 
 				<div id="push">
@@ -481,4 +498,8 @@
 
 	render: function() {
+		var path = window.location.pathname.split('/');
+		if (path.length === 3 && path[2] === 'embed') {
+			return false;
+		}
 		return	(
 			<div className="container">
@@ -521,4 +542,6 @@
 		} else if (p === 'stats') {
 			this.toStatistics(false);
+		} else if (p === 'embed') {
+			this.toEmbedded(false);
 		} else {
 			this.toAggregator(false);
Index: SRUAggregator/trunk/src/main/resources/assets/js/search.js
===================================================================
--- SRUAggregator/trunk/src/main/resources/assets/js/search.js	(revision 6097)
+++ SRUAggregator/trunk/src/main/resources/assets/js/search.js	(revision 6111)
@@ -175,5 +175,6 @@
 var AggregatorPage = window.MyAggregator.AggregatorPage = React.createClass({displayName: 'AggregatorPage',
 	propTypes: {
-		ajax: PT.func.isRequired
+		ajax: PT.func.isRequired,
+		embedded: PT.bool,
 	},
 
@@ -223,5 +224,5 @@
 	search: function() {
 		var query = this.state.query;
-		if (!query) {
+		if (!query || this.props.embedded) {
 			this.setState({ hits: this.nohits, searchId: null });
 			return;			
@@ -429,4 +430,21 @@
 	},
 
+	renderSearchButtonOrLink: function() {
+		if (this.props.embedded) {
+			var query = this.state.query;
+			var newurl = query ? (window.MyAggregator.URLROOT + "?search=" + query) : "#";
+			return (
+				React.createElement("a", {className: "btn btn-default input-lg", type: "button", target: "_blank", href: newurl}, 
+					React.createElement("i", {className: "glyphicon glyphicon-search"})
+				)
+			);
+		}
+		return (
+			React.createElement("button", {className: "btn btn-default input-lg", type: "button", onClick: this.search}, 
+				React.createElement("i", {className: "glyphicon glyphicon-search"})
+			) 
+		);
+	},
+
 	render: function() {
 		var layer = layerMap[this.state.searchLayerId];
@@ -444,7 +462,5 @@
 								tabIndex: "1", onChange: this.onQuery, onKeyDown: this.handleKey}), 
 							React.createElement("div", {className: "input-group-btn"}, 
-								React.createElement("button", {className: "btn btn-default input-lg", type: "button", onClick: this.search}, 
-									React.createElement("i", {className: "glyphicon glyphicon-search"})
-								)
+								this.renderSearchButtonOrLink()
 							)
 						)
@@ -486,4 +502,5 @@
 							), 
 
+							 this.props.embedded ? false : 
 							React.createElement("div", {className: "input-group"}, 
 								React.createElement("span", {className: "input-group-addon nobkg"}, "in"), 
@@ -491,6 +508,7 @@
 									this.state.corpora.getSelectedMessage(), " ", React.createElement("span", {className: "caret"})
 								)
-							), 							
-
+							), 
+
+							 this.props.embedded ? false : 
 							React.createElement("div", {className: "input-group"}, 
 								React.createElement("span", {className: "input-group-addon nobkg"}, "and show up to"), 
Index: SRUAggregator/trunk/src/main/resources/assets/js/search.jsx
===================================================================
--- SRUAggregator/trunk/src/main/resources/assets/js/search.jsx	(revision 6097)
+++ SRUAggregator/trunk/src/main/resources/assets/js/search.jsx	(revision 6111)
@@ -175,5 +175,6 @@
 var AggregatorPage = window.MyAggregator.AggregatorPage = React.createClass({
 	propTypes: {
-		ajax: PT.func.isRequired
+		ajax: PT.func.isRequired,
+		embedded: PT.bool,
 	},
 
@@ -223,5 +224,5 @@
 	search: function() {
 		var query = this.state.query;
-		if (!query) {
+		if (!query || this.props.embedded) {
 			this.setState({ hits: this.nohits, searchId: null });
 			return;			
@@ -429,4 +430,21 @@
 	},
 
+	renderSearchButtonOrLink: function() {
+		if (this.props.embedded) {
+			var query = this.state.query;
+			var newurl = query ? (window.MyAggregator.URLROOT + "?search=" + query) : "#";
+			return (
+				<a className="btn btn-default input-lg" type="button" target="_blank" href={newurl}>
+					<i className="glyphicon glyphicon-search"></i>
+				</a>
+			);
+		}
+		return (
+			<button className="btn btn-default input-lg" type="button" onClick={this.search}>
+				<i className="glyphicon glyphicon-search"></i>
+			</button> 
+		);
+	},
+
 	render: function() {
 		var layer = layerMap[this.state.searchLayerId];
@@ -444,7 +462,5 @@
 								tabIndex="1" onChange={this.onQuery} onKeyDown={this.handleKey} />
 							<div className="input-group-btn">
-								<button className="btn btn-default input-lg" type="button" onClick={this.search}>
-									<i className="glyphicon glyphicon-search"></i>
-								</button>
+								{this.renderSearchButtonOrLink()}
 							</div>
 						</div>
@@ -486,4 +502,5 @@
 							</div>
 
+							{ this.props.embedded ? false : 
 							<div className="input-group">
 								<span className="input-group-addon nobkg">in</span>
@@ -491,6 +508,7 @@
 									{this.state.corpora.getSelectedMessage()} <span className="caret"/>
 								</button>
-							</div>							
-
+							</div> }
+
+							{ this.props.embedded ? false : 
 							<div className="input-group">
 								<span className="input-group-addon nobkg">and show up to</span>
@@ -502,5 +520,5 @@
 								</div>
 								<span className="input-group-addon nobkg">hits</span>
-							</div>
+							</div> }
 						</form>
 					</div>
