Revision e27e3ff2
Added by Andreas Kohlbecker almost 5 years ago
modules/cdm_dataportal/js/utis-client/utis-client.js | ||
---|---|---|
14 | 14 |
var defaults = { |
15 | 15 |
providers: {'bgbm-phycobank': 'PhycoBank', 'diatombase' : 'DiatomBase', 'worms': 'WoRMS'}, |
16 | 16 |
// webserviceUrl : 'https://cybertaxonomy.eu/eu-bon/utis/1.3', |
17 |
webserviceUrl : 'http://test.e-taxonomy.eu/eubon-utis', |
|
17 |
// webserviceUrl : 'http://test.e-taxonomy.eu/eubon-utis', |
|
18 |
webserviceUrl : 'http://localhost:8081/', |
|
18 | 19 |
pageSize: 20, |
19 | 20 |
spinnerIcon: null |
20 | 21 |
}; |
... | ... | |
30 | 31 |
this.spinnerContainer = null; |
31 | 32 |
this.pageIndex = 0; |
32 | 33 |
this.autoLoadTolerance = 20; // start autoloading x pixels before the bottom of the result container |
34 |
this.externalLinkIconMarkup = '[open]'; |
|
33 | 35 |
|
34 | 36 |
// firebug console stub (avoids errors if firebug is not active) |
35 | 37 |
if (typeof console === "undefined") { |
... | ... | |
159 | 161 |
var icon = $(this.options.spinnerIcon); |
160 | 162 |
this.spinnerContainer.append(icon); |
161 | 163 |
} |
164 |
if(this.options.externalLinkIcon !== undefined){ |
|
165 |
this.externalLinkIconMarkup = this.options.externalLinkIcon; |
|
166 |
} |
|
162 | 167 |
}, |
163 | 168 |
|
164 | 169 |
/** |
... | ... | |
220 | 225 |
count++; |
221 | 226 |
} |
222 | 227 |
}); |
223 |
if(count === 0){ |
|
228 |
if(count === 0 && plugin.pageIndex === 0){
|
|
224 | 229 |
plugin.spinnerContainer.before($('<div/>', {'class': 'no-results', style: 'height: 100%; text-align: center; v-align: middle;'}).text("No results.")) |
225 | 230 |
} |
226 | 231 |
plugin.spinnerContainer.hide(); |
... | ... | |
230 | 235 |
makeResultEntry: function (record) { |
231 | 236 |
|
232 | 237 |
var resultEntry = $('<div/>', {'class': 'result-entry'}); |
233 |
resultEntry.append($('<div/>', {'class': 'matching-name', style: 'font-weight: bold;'}).text(record.matchingNameString)); |
|
238 |
var taxonContainer = $('<div/>'); |
|
239 |
taxonContainer.append($('<span/>', {'class': 'matching-name', style: 'font-weight: bold; padding-right: 0.3em;'}).text(record.matchingNameString)); |
|
240 |
if(record.taxon.url){ |
|
241 |
taxonContainer.append($('<a/>', {href: record.taxon.url, target: 'provider'}).append($(this.externalLinkIconMarkup))); |
|
242 |
} |
|
243 |
resultEntry.append(taxonContainer); |
|
234 | 244 |
|
235 | 245 |
var relation = record.matchingNameType; |
236 | 246 |
var taxonName = record.taxon.taxonName.scientificName; |
... | ... | |
242 | 252 |
.append($('<span/>', {'class': 'taxon'}).text(taxonName)); |
243 | 253 |
} |
244 | 254 |
resultEntry.append($('<div/>', {'class': 'checklist', style: 'opacity: 0.5; '}).text('Checklist: ') // text-align: right? |
245 |
.append($('<a/>', { href: record.checklistUrl, target: 'checklist'}).text(record.checklist)
|
|
255 |
.append($('<a/>', { href: record.checklistUrl, target: 'provider'}).text(record.checklist)
|
|
246 | 256 |
) |
247 | 257 |
); |
248 | 258 |
} |
Also available in: Unified diff
ref #8388 UTIS search block: linking to taxon urls