Skip to content

Commit

Permalink
Revert "- removed the option to show results in different layouts"
Browse files Browse the repository at this point in the history
  • Loading branch information
mariobehling authored Sep 5, 2016
1 parent fa23552 commit a074457
Show file tree
Hide file tree
Showing 3 changed files with 214 additions and 225 deletions.
6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

29 changes: 15 additions & 14 deletions js/yacysearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,28 @@ var SearchModel = Backbone.Model.extend({

html += "<p class=\"navbutton\"></p><div class=\"btn-group btn-group-justified\">";
var u = this.attributes.servlet + "?query=" + this.attributes.query + "&startRecord=" + this.attributes.start;
if (this.attributes.layout == "paragraph") {
if (this.attributes.layout == "paragraph" || this.attributes.layout == "table") {
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default active\">Documents</button></div>";
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default\" onclick=\"window.location.href='" + u + "&maximumRecords=100&layout=images&contentdom=image'\">Images</button></div>";
}

// If image results needed

// if (this.attributes.layout == "images") {
// html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default\" onclick=\"window.location.href='" + u + "&maximumRecords=10&layout=paragraph&contentdom=text'\">Documents</button></div>";
// html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default active\">Images</button></div>";
// }
if (this.attributes.layout == "images") {
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default\" onclick=\"window.location.href='" + u + "&maximumRecords=10&layout=paragraph&contentdom=text'\">Documents</button></div>";
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default active\">Images</button></div>";
}
html += "</div>";


// in case of document: document type navigation
if (this.attributes.layout == "paragraph") {
if (this.attributes.layout == "paragraph" || this.attributes.layout == "table") {
var u = this.attributes.servlet + "?query=" + this.attributes.query + "&startRecord=" + this.attributes.start + "&maximumRecords=" + this.attributes.rows;
html += "<p class=\"navbutton\"></p><div class=\"btn-group btn-group-justified\">";
if (this.attributes.layout == "paragraph") {
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default active\">Paragraph Layout</button></div>";
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default\" onclick=\"window.location.href='" + u + "&layout=table&contentdom=all'\">Table Layout</button></div>";
}
if (this.attributes.layout == "table") {
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default\" onclick=\"window.location.href='" + u + "&layout=paragraph&contentdom=text'\">Paragraph Layout</button></div>";
html += "<div class=\"btn-group btn-group-xs\"><button type=\"button\" class=\"btn btn-default active\">Table Layout</button></div>";
}
html += "</div>";
}
Expand Down Expand Up @@ -141,7 +142,7 @@ var RowModel = Backbone.Model.extend({
html += "<p class=\"urlinfo\">" + pdnt + "</p>";
html += "</div>";
}
/*

if (style == "tableRow") {
html += "<tr>";
html += "<td><a class=\"sans headlinecolor\" style=\"text-decoration:none\" href=\"" + protocol + "://" + host + "/" + "\">" + protocol + "://" + host + "</a></td>"; // Host
Expand All @@ -159,7 +160,7 @@ var RowModel = Backbone.Model.extend({
html += "<img src=\"" + image + "\" width=\"96\" height=\"96\" />";
html += "</a>";
}
*/

// return entry
return html;
}
Expand All @@ -182,7 +183,7 @@ var RowCollection = Backbone.Collection.extend({
return html;
},

/*resultTable:function() {
resultTable:function() {
var html = "";
if (this.length > 0) {
html += "<table class=\"table table-condensed table-striped\">";
Expand All @@ -191,7 +192,7 @@ var RowCollection = Backbone.Collection.extend({
html += "</tbody></table>";
}
return html;
},*/
},

resultImages:function() {
var html = "";
Expand Down Expand Up @@ -286,7 +287,7 @@ var NavigationCollection = Backbone.Collection.extend({
}
return elts;
},

facet:function(name){
for (i = 0; i < this.length; i++) {
var facet = this.at(i);
Expand Down
Loading

0 comments on commit a074457

Please sign in to comment.