Commit 0f8bdfb4 authored by Gradl, Tobias's avatar Gradl, Tobias
Browse files

Merge branch 'mww' into 'master'

Mww

See merge request !1
parents 3b3a928a edc2e814
......@@ -60,6 +60,10 @@ h5, .h5 {
.search-result-image-tmb {
height: 135px;
width: 135px;
}
.search-result-image-tmb,
.item-image {
background-repeat:no-repeat;
background-position: center center;
background-size: cover;
......@@ -133,6 +137,47 @@ h5, .h5 {
text-align: center;
vertical-align: middle;
}
/*!
* Individual item view
*/
#carousel-item-images {
margin: 0 auto;
background-color: #FFF;
padding: 5px;
border: 1px solid #DDD;
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
/* Android ≤ 1.6, iOS 1-3.2, Safari 3-4 */
-webkit-border-radius: 5px;
/* Android 2.1+, Chrome, Firefox 4+, IE 9+, iOS 4+, Opera 10.50+, Safari 5+ */
border-radius: 5px;
/* useful if you don't want a bg color from leaking outside the border: */
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
#carousel-item-images .carousel-control.right,
#carousel-item-images .carousel-control.left {
color: #222;
text-shadow: 1px 1px 5px #FFF;
}
#carousel-item-images .carousel-indicators li {
background-color: rgba(34, 34, 34, 0.5);
/*border-color: rgba(34, 34, 34, 1);*/
}
#carousel-item-images .carousel-indicators li.active {
background-color: rgba(34, 34, 34, 0.9);
/*border-color: rgba(34, 34, 34, 1);*/
}
/*!
......@@ -492,6 +537,19 @@ div.panel.panel-search-result > .panel-heading {
border-color: #002547;
}
div.panel.panel-search-result > .panel-heading h3 {
font-size: 130%;
}
div.panel.panel-search-result > .panel-heading h3 a .fa {
visibility: hidden;
}
div.panel.panel-search-result > .panel-heading h3 a:hover .fa,
div.panel.panel-search-result > .panel-heading h3 a:active .fa {
visibility: visible;
}
div.panel.panel-search-result > .panel-body {
padding-bottom: 0;
}
......
var resultItem;
$(document).ready(function() {
resultItem = new ResultItem();
});
$(window).resize(function() {
resultItem.resize();
});
var ResultItem = function(options) {
this.options = $.extend({
images : {
maxWidth : 400
}
}, options);
this.resize();
$('.venobox').venobox();
};
ResultItem.prototype.resize = function() {
var innerWidth = $("#item-images-container").width();
if (innerWidth > this.options.images.maxWidth) {
innerWidth = this.options.images.maxWidth;
}
var containerWidth = $("#item-images-container").width();
if (containerWidth > this.options.images.maxWidth+150) {
containerWidth = this.options.images.maxWidth+150;
}
$("#carousel-item-images").css("width", innerWidth + "px");
$(".item-image").css("height", innerWidth + "px");
$(".item-image").css("width", innerWidth + "px");
};
\ No newline at end of file
......@@ -333,8 +333,8 @@ QueryHandler.prototype.processResponse = function(data, isShowMore) {
dataType: "text",
success: function(template) {
_this.processResponseResources(isShowMore, data.resultElements, data.startIndex, data.totalHits, data.took, data.hasMore, template);
_this.processResponseTerms();
_this.processResponseSubjects();
/*_this.processResponseTerms();
_this.processResponseSubjects();*/
_this.processResponseDatasources(data.resultDatasources);
},
error : function() {}
......@@ -426,17 +426,17 @@ QueryHandler.prototype.processResponseDatasources = function(datasources) {
"<div id=\"datasource-aggregation-carousel-" + datasources[i].providerId + "\" class=\"aggregation-carousel carousel slide\" data-ride=\"carousel\">" +
"<ol class=\"carousel-indicators\">" +
"<li data-target=\"#datasource-aggregation-carousel-" + datasources[i].providerId + "\" data-slide-to=\"0\" class=\"active\"></li>" +
"<li data-target=\"#datasource-aggregation-carousel-" + datasources[i].providerId + "\" data-slide-to=\"1\"></li>" +
/*"<li data-target=\"#datasource-aggregation-carousel-" + datasources[i].providerId + "\" data-slide-to=\"1\"></li>" +*/
"</ol>" +
"<div class=\"carousel-inner\" role=\"listbox\">" +
"<div class=\"item active\">" +
"<h5>" + __translator.translate("~eu.dariah.de.minfba.search.search.collections.terms") + "</h5>" +
"<div id=\"datasource-wordcloud-" + datasources[i].providerId + "-Wordcloud\" class=\"wordcloud\" style=\"height: " + this.options.wordcloud.height + "px;\"></div>" +
"</div>" +
"<div class=\"item\">" +
/*"<div class=\"item\">" +
"<h5>" + __translator.translate("~eu.dariah.de.minfba.search.search.collections.subjects") + "</h5>" +
"<div id=\"datasource-wordcloud-" + datasources[i].providerId + "-Subject\" class=\"wordcloud\" style=\"height: " + this.options.wordcloud.height + "px;\"></div>" +
"</div>" +
"</div>" +*/
"</div>" +
"<a class=\"left carousel-control\" href=\"#datasource-aggregation-carousel-" + datasources[i].providerId + "\" role=\"button\" data-slide=\"prev\">" +
"<span class=\"glyphicon glyphicon-chevron-left\" aria-hidden=\"true\"></span>" +
......@@ -460,7 +460,7 @@ QueryHandler.prototype.processResponseDatasources = function(datasources) {
// Deep clone of the original query
/*var tagQuery = jQuery.extend(true, {}, _this.query);*/
tagQuery.sourceIds = [ datasources[i].providerId ];
tagQuery.tagAggregators = ["Wordcloud", "Subject"];
tagQuery.tagAggregators = ["Wordcloud"/*, "Subject"*/];
tagQuery.size = this.options.wordcloud.tags.size;
if (datasources[i].loadTags) {
......@@ -553,6 +553,8 @@ QueryHandler.prototype.processResponseResources = function(isShowMore, resultEle
// TODO arrays, rest
content.push(["datasource", resultElements[i].collectionName]);
content.push(["resultId", encodeURIComponent(resultElements[i].id).replace(/[!'()]/g, escape).replace(/\*/g, "%2A")]);
content.push(["type", resultElements[i].datasetId]);
if (explain) {
content.push(["score", __translator.translate("~eu.dariah.de.minfba.search.view.result.resources.score") + ": " + resultElements[i].score]);
......@@ -560,13 +562,13 @@ QueryHandler.prototype.processResponseResources = function(isShowMore, resultEle
content.push(["score", ""]);
}
if (resultElements[i].original!==undefined && resultElements[i].original!==null) {
content.push(["original", resultElements[i].original]);
if (resultElements[i].contentHtml!==undefined && resultElements[i].contentHtml!==null) {
content.push(["original", resultElements[i].contentHtml]);
} else {
hideElements.push(".original-data-panel");
}
content.push(["snippet", resultElements[i].snippet]);
content.push(["snippet", resultElements[i].integrationHtml]);
if (resultElements[i].explanation != null) {
content.push(["explanation", resultElements[i].explanation]);
......@@ -574,30 +576,30 @@ QueryHandler.prototype.processResponseResources = function(isShowMore, resultEle
$(itemTemplate).find(".search-result-subpanel").addClass("hide");
}
if (resultElements[i].info !== undefined && resultElements[i].info != null &&
resultElements[i].info.Presentation !== undefined) {
if (resultElements[i].presentation !== undefined && resultElements[i].presentation != null &&
resultElements[i].presentation.Presentation !== undefined) {
if (resultElements[i].info.Presentation.Title !== undefined) {
content.push(["title", resultElements[i].info.Presentation.Title, 500]);
if (resultElements[i].presentation.Presentation.Title !== undefined) {
content.push(["title", resultElements[i].presentation.Presentation.Title, 500]);
} else {
content.push(["title", "<em>" + __translator.translate("~eu.dariah.de.minfba.search.view.result.no_title") + "</em>"]);
}
if (resultElements[i].info.Presentation.Link !== undefined) {
if(resultElements[i].info.Presentation.Link instanceof Array) {
if (resultElements[i].presentation.Presentation.Link !== undefined) {
if(resultElements[i].presentation.Presentation.Link instanceof Array) {
var link = "";
for (var j=0; j<resultElements[i].info.Presentation.Link.length; j++) {
if (resultElements[i].info.Presentation.Link[j]["~"]===undefined) {
link += this.createLink(resultElements[i].info.Presentation.Link[j].URL, resultElements[i].info.Presentation.Link[j].Type);
} else if (resultElements[i].info.Presentation.Link[j]["~"].startsWith("http")) {
link += this.createLink(resultElements[i].info.Presentation.Link[j]);
for (var j=0; j<resultElements[i].presentation.Presentation.Link.length; j++) {
if (resultElements[i].presentation.Presentation.Link[j]["~"]===undefined) {
link += this.createLink(resultElements[i].presentation.Presentation.Link[j].URL, resultElements[i].presentation.Presentation.Link[j].Type);
} else if (resultElements[i].presentation.Presentation.Link[j]["~"].startsWith("http")) {
link += this.createLink(resultElements[i].presentation.Presentation.Link[j]);
}
}
content.push(["link", {"~": link}]);
} else {
if (resultElements[i].info.Presentation.Link["~"]===undefined) {
content.push(["link", {"~": this.createLink(resultElements[i].info.Presentation.Link.URL, resultElements[i].info.Presentation.Link.Type)}])
} else if (resultElements[i].info.Presentation.Link["~"].startsWith("http")) {
content.push(["link", {"~": this.createLink(resultElements[i].info.Presentation.Link)}])
if (resultElements[i].presentation.Presentation.Link["~"]===undefined) {
content.push(["link", {"~": this.createLink(resultElements[i].presentation.Presentation.Link.URL, resultElements[i].presentation.Presentation.Link.Type)}])
} else if (resultElements[i].presentation.Presentation.Link["~"].startsWith("http")) {
content.push(["link", {"~": this.createLink(resultElements[i].presentation.Presentation.Link)}])
}
}
} else {
......@@ -607,8 +609,8 @@ QueryHandler.prototype.processResponseResources = function(isShowMore, resultEle
/*if (resultElements[i].info.Presentation.Images!==undefined && resultElements[i].info.Presentation.Images.Resource!==undefined) {
this.handleImages(resultElements[i].info.Presentation.Images.Resource, i);
/*if (resultElements[i].presentation.Presentation.Images!==undefined && resultElements[i].presentation.Presentation.Images.Resource!==undefined) {
this.handleImages(resultElements[i].presentation.Presentation.Images.Resource, i);
} else {
$("#search-results-image-carousel-" + i).remove();
......@@ -616,16 +618,16 @@ QueryHandler.prototype.processResponseResources = function(isShowMore, resultEle
$("#search-results-resources").append(this.renderResultItem(itemTemplate, content, hideElements));
if (resultElements[i].info.Presentation.Images!==undefined && resultElements[i].info.Presentation.Images.Resource!==undefined) {
this.handleImages(resultElements[i].collectionId, resultElements[i].endpointId, resultElements[i].datasetId, this.getValues(resultElements[i].info.Presentation.Images.Resource), i, false);
if (resultElements[i].presentation.Presentation.Images!==undefined && resultElements[i].presentation.Presentation.Images.Resource!==undefined) {
this.handleImages(resultElements[i].collectionId, resultElements[i].endpointId, resultElements[i].datasetId, this.getValues(resultElements[i].presentation.Presentation.Images.Resource), i, false);
} else {
if (resultElements[i].info.Presentation.Images!==undefined && resultElements[i].info.Presentation.Images.Placeholder!==undefined) {
this.handleImages(resultElements[i].collectionId, resultElements[i].endpointId, resultElements[i].datasetId, this.getValues(resultElements[i].info.Presentation.Images.Placeholder), i, true);
if (resultElements[i].presentation.Presentation.Images!==undefined && resultElements[i].presentation.Presentation.Images.Placeholder!==undefined) {
this.handleImages(resultElements[i].collectionId, resultElements[i].endpointId, resultElements[i].datasetId, this.getValues(resultElements[i].presentation.Presentation.Images.Placeholder), i, true);
}
}
if (resultElements[i].info.Presentation.Objects!==undefined) {
this.handleObjects(resultElements[i].info.Presentation.Objects, i);
if (resultElements[i].presentation.Presentation.Objects!==undefined) {
this.handleObjects(resultElements[i].presentation.Presentation.Objects, i);
}
} else {
content.push(["title", "<em>" + __translator.translate("~eu.dariah.de.minfba.search.view.result.no_title") + "</em>"]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment