Skip to content
This repository was archived by the owner on May 28, 2024. It is now read-only.
14 changes: 12 additions & 2 deletions js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ $(document).ready(function() {
var
urlRegex = /(#(.+)|\/([^\/#]+))$/,
fragidRegex = /^#row=(\d+)(-(\d+))?$/,
dontShowUri = /\&showUri=false/.test(document.location.search) ? true : false,

extractMetadata = function (metadata, fields) {
var value;
Expand Down Expand Up @@ -64,7 +65,10 @@ $(document).ready(function() {
v += '</div>';
return v;
} else if (value['@id']) {
return '<a href="' + value['@id'] + '"><i class="icon-share"></i></a>';
if(dontShowUri)
return '<a href="' + value['@id'] + '"><i class="icon-share"></i></a>';
else
return '<a href="' + value['@id'] + '">' + value['@id'] + '</a>';
} else if (value['@value']) {
v = value['@value'].replace(/\s+/, '&nbsp;');
if (includeBadge) {
Expand Down Expand Up @@ -406,8 +410,14 @@ $(document).ready(function() {
},

query = document.location.search,
url = /^\?url=/.test(query) ? decodeURIComponent(query.substring(5)) : null,
url,
filename;

var pos = query.indexOf("&showUri");
if (pos != -1)
url = /^\?url=/.test(query) ? decodeURIComponent(query.substring(5,pos)) : null;
else
url = /^\?url=/.test(query) ? decodeURIComponent(query.substring(5)) : null;

if (url) {
filename = urlRegex.exec(url)[3];
Expand Down
3 changes: 2 additions & 1 deletion js/jquery.linked-csv.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
'skos-xl': "http://www.w3.org/2008/05/skos-xl#", // SKOS Extensions for Labels
},
prefixRegex = new RegExp('^(' + Object.keys(namespaces).join('|') + '):(.+)$'),
uriRegex = /^(([a-z][\-a-z0-9+\.]*):){1}(\/\/([^\/?#]+))?([^?#]*)?(\?([^#]*))?(#(.*))?$/i,

init = function (linkedCSV, data, base) {
var
Expand Down Expand Up @@ -52,7 +53,7 @@
},
parseValue = function(value, type, lang) {
var val = value;
if (type === 'url') {
if (type === 'url' || uriRegex.test(value)) {
val = {
'@id': $.uri.resolve(value, base).toString()
};
Expand Down