Skip to content

Commit 2425bf8

Browse files
committed
Type, date and provider information removed from standard view. They are now only displayed in detailed view on mouse over. Also now the provider information is only displayed as text without favicon and the result item's action buttons were shifted horizintally that they are on the same width than the settings button. -> #34 fixed
1 parent d8a965c commit 2425bf8

2 files changed

Lines changed: 38 additions & 39 deletions

File tree

SearchResultList.html

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,19 @@
134134
var item = items[i];
135135

136136
var li = $('<li></li>');
137-
var leftColumn = $('<div class="left-column"></div>');
138-
li.append(leftColumn);
139-
var rightColumn = $('<div class="right-column"></div>');
140-
li.append(rightColumn);
137+
138+
// item containers
139+
var contentDiv = $('<div class="result-container"></div>');
140+
li.append(contentDiv);
141+
142+
var resultContent = $('<div class="result-content"></div>');
143+
contentDiv.append(resultContent);
144+
145+
var resultButtons = $('<div class="result-buttons"></div>');
146+
contentDiv.append(resultButtons);
147+
148+
var resultFooter = $('<div class="result-footer"></div>');
149+
li.append(resultFooter);
141150

142151
// description
143152
var description = item.description;
@@ -150,13 +159,8 @@
150159
// link
151160
var uri = item.documentBadge.uri;
152161
var link = $('<a href="' + uri + '" target="_blank" title="' + description + '"></a>');
153-
leftColumn.append(link);
154-
155-
// item containers
156-
var contentDiv = $('<div class="result-content"></div>');
157-
var footerDiv = $('<div class="result-footer"></div>');
158-
link.append(contentDiv);
159-
link.append(footerDiv);
162+
resultContent.append(link);
163+
resultContent = link;
160164

161165
// title
162166
var title = item.title;
@@ -165,7 +169,7 @@
165169
} else {
166170
title = this._formatTitle(title);
167171
}
168-
contentDiv.append($('<span class="result-title">' + title + '</span>'));
172+
resultContent.append($('<span class="result-title">' + title + '</span>'));
169173

170174
// insert link buttons
171175
var insertAsLinkButton = $(
@@ -177,7 +181,7 @@
177181
insertAsLinkButton.click(function() {
178182
google.script.run.insertLink($(this).data('uri'), $(this).data('title'));
179183
});
180-
rightColumn.append(insertAsLinkButton);
184+
resultButtons.append(insertAsLinkButton);
181185

182186
// type
183187
var mediaType = item.mediaType;
@@ -186,7 +190,7 @@
186190
}
187191
mediaType = mediaType.toLowerCase(); // TODO rm lowercase if issue fixed: https://github.com/EEXCESS/recommender/issues/16
188192
var type = $('<span class="result-type secondary"><?!= msg('SEARCH_RESULT_LIST_MEDIATYPE') ?>: ' + this._getMediaTypeName(mediaType) + '</span>');
189-
footerDiv.append(type);
193+
resultFooter.append(type);
190194

191195
// image
192196
var image = item.previewImage;
@@ -204,23 +208,23 @@
204208
insertImageButton.click(function() {
205209
google.script.run.insertImage($(this).data('uri'));
206210
});
207-
rightColumn.append(insertImageButton);
211+
resultButtons.append(insertImageButton);
208212
}
209213
var img = $('<img align="left" class="result-image" mediatype="' + mediaType + '" src="' + image + '"/>');
210-
contentDiv.prepend(img);
214+
resultContent.prepend(img);
211215

212216
// date
213217
var date = item.date;
214218
if (date !== 'undefined' && date !== '' && date !== 'unknown') {
215219
var dateLabel = $('<span class="result-date secondary">' + this._formatDate(date) + '</span>');
216-
footerDiv.append(dateLabel);
220+
resultFooter.append(dateLabel);
217221
}
218222

219223
// provider
220224
var provider = item.documentBadge.provider;
221225
if (typeof provider !== 'undefined') {
222226
var providerFormatted = formatString(provider);
223-
footerDiv.append($('<img alt="' + provider + '" title="<?!= msg('SEARCH_RESULT_LIST_PROVIDER') ?>: ' + provider + '" src="http://eexcess-dev.joanneum.at/eexcess-federated-recommender-web-service-1.0-SNAPSHOT/recommender/getPartnerFavIcon?partnerId=' + provider + '" class="partner-icon" />'));
227+
resultFooter.append($('<span class="result-provider secondary" title="<?!= msg('SEARCH_RESULT_LIST_PROVIDER') ?>: ' + provider + '">' + shortenString(provider, 15) + '</span>'));
224228
$(li).addClass('provider-' + providerFormatted);
225229
}
226230

@@ -232,11 +236,6 @@
232236
var mediaType = $(this).attr("mediaType");
233237
$(this).attr("src", "http://eexcess-dev.joanneum.at/eexcess-federated-recommender-web-service-1.0-SNAPSHOT/recommender/getPreviewImage?type=" + mediaType);
234238
});
235-
236-
this._results.find('.partner-icon').error(function() {
237-
$(this).unbind("error");
238-
$(this).hide();
239-
});
240239
}
241240

242241
this.restoreTab();
@@ -263,7 +262,7 @@
263262
var maxDateLength = 7;
264263

265264
if (date.length > maxDateLength) {
266-
date = date.substring(0, maxDateLength) + '...';
265+
date = date.substring(0, maxDateLength);
267266
}
268267

269268
return date;

Stylesheet.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
#settings-button {
7272
position: absolute;
73-
right: 12px;
73+
right: 20px;
7474
top: 46px;
7575
}
7676

@@ -162,7 +162,6 @@
162162
border-collapse: collapse;
163163
width: 260px;
164164
padding: 10px;
165-
min-height: 60px;
166165
}
167166

168167
#result-list li:last-child {
@@ -173,12 +172,13 @@
173172
background-color: #eeeeee;
174173
}
175174

176-
#result-list .left-column {
175+
.result-content {
177176
width: 228px;
178177
float: left;
179178
}
180179

181-
#result-list .right-column {
180+
.result-buttons {
181+
padding-bottom: 5px;
182182
float: right;
183183
}
184184

@@ -190,8 +190,8 @@
190190
margin-top: 5px;
191191
}
192192

193-
.result-content {
194-
display: inline-block;
193+
.result-container {
194+
overflow: auto;
195195
}
196196

197197
.result-image {
@@ -206,21 +206,21 @@
206206
}
207207

208208
.result-footer {
209-
position: relative;
210209
text-align: center;
211-
height: 16px;
210+
margin-right: 5px;
211+
visibility: hidden;
212+
}
213+
214+
#result-list li:hover .result-footer {
215+
visibility: visible;
212216
}
213217

214218
.result-type {
215-
position: absolute;
216-
left: 0;
219+
float: left;
217220
}
218221

219-
.partner-icon {
220-
width: 16px;
221-
height: 16px;
222-
position: absolute;
223-
right: 0;
222+
.result-provider {
223+
float: right;
224224
}
225225

226226
/* result categories */

0 commit comments

Comments
 (0)