Skip to content

Commit 358e6f1

Browse files
committed
'Source' button go to art:sourceLocation if it exists
1 parent f724c11 commit 358e6f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

system/application/views/widgets/import/jquery.scalarimport.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ if ('undefined'==typeof(escape_html)) {
257257
if ('object'==typeof(results_data[j].thumb) && results_data[j].thumb.length) results_data[j].thumb = results_data[j].thumb[0];
258258
results_data[j].mediatype = ('undefined'!=typeof(post[j]['dcterms:type'])) ? post[j]['dcterms:type'] : 'Media';
259259
results_data[j].contributor = ('undefined'!=typeof(post[j]['dcterms:contributor'])) ? post[j]['dcterms:contributor'] : null;
260-
260+
results_data[j].sourceLocation = ('undefined'!=typeof(post[j]['art:sourceLocation'])) ? post[j]['art:sourceLocation'] : null;
261+
261262
}
262263

263264
return results_data;
@@ -477,7 +478,7 @@ if ('undefined'==typeof(escape_html)) {
477478
} else {
478479
var url_str = '<div class="url">';
479480
url_str += '<a href="javascript:;" onclick="scalarimport_preview(\''+results_data[j].url+'\')" class="btn btn-default btn-xs generic_button small">Preview</a>&nbsp; ';
480-
url_str += '<a href="'+results_data[j].node_uri+'" target="_blank" class="btn btn-default btn-xs generic_button small">Source</a>&nbsp; ';
481+
url_str += '<a href="'+((null!=results_data[j].sourceLocation) ? results_data[j].sourceLocation : results_data[j].node_uri)+'" target="_blank" class="btn btn-default btn-xs generic_button small">Source</a>&nbsp; ';
481482
url_str += '<span>'+results_data[j].mediatype+': '+basename(results_data[j].url)+'</span>';
482483
url_str += '</div>';
483484
$(url_str).appendTo($content);

0 commit comments

Comments
 (0)