From: <tob...@us...> - 2014-04-07 22:34:44
|
Revision: 8080 http://sourceforge.net/p/bigdata/code/8080 Author: tobycraig Date: 2014-04-07 22:34:42 +0000 (Mon, 07 Apr 2014) Log Message: ----------- #880 - Absolute URIs now have < > around them Modified Paths: -------------- branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-07 21:45:05 UTC (rev 8079) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-07 22:34:42 UTC (rev 8080) @@ -599,6 +599,9 @@ var text = getSID(binding); } else { var text = binding.value; + if(binding.type == 'uri') { + text = '<' + text + '>'; + } } linkText = escapeHTML(text).replace(/\n/g, '<br>'); if(binding.type == 'typed-literal') { @@ -646,12 +649,18 @@ loadURI(uri); // if this is a SID, make the components clickable - var re = /<< *<([^<>]*)> *<([^<>]*)> *<([^<>]*)> *>>/; + var re = /<< *(<[^<>]*>) *(<[^<>]*>) *(<[^<>]*>) *>>/; var match = uri.match(re); if(match) { - $('#explore-header').html('<h1><< <<a href="' + buildExploreHash(match[1]) + '">' + match[1] + '</a>><br><<a href="' + buildExploreHash(match[2]) + '">' + match[2] + '</a> ><br><<a href="' + buildExploreHash(match[3]) + '">' + match[3] + '</a> > >></h1>'); + var header = $('<h1>'); + header.append('<< <br>'); + for(var i=1; i<4; i++) { + header.append($('<a href="' + buildExploreHash(match[i]) + '">').text(match[i])).append('<br>'); + } + header.append(' >>'); + $('#explore-header').html(header); } else { - $('#explore-header').html('<h1>' + uri + '</h1>'); + $('#explore-header').html($('<h1>').text(uri)); } } }); @@ -668,7 +677,7 @@ var vertexQuery = '\ select ?col1 ?col2 ?incoming (count(?star) as ?star) {\n\ - bind (<URI> as ?explore ) .\n\ + bind (URI as ?explore ) .\n\ {\n\ bind (<<?explore ?col1 ?col2>> as ?sid) . \n\ bind (false as ?incoming) . \n\ @@ -741,6 +750,9 @@ var uri = getSID(col); } else { var uri = col.value; + if(col.type == 'uri') { + uri = '<' + uri + '>'; + } } output = escapeHTML(uri).replace(/\n/g, '<br>'); if(col.type == 'uri' || col.type == 'sid') { @@ -751,9 +763,9 @@ var star = parseInt(binding.star.value); if(star > 0) { if(binding.incoming.value == 'true') { - var sid = '<< <' + binding.col1.value + '> <' + binding.col2.value + '> <' + $('#explore-form input[type=text]').val() + '> >>'; + var sid = '<< <' + binding.col1.value + '> <' + binding.col2.value + '> ' + $('#explore-form input[type=text]').val() + ' >>'; } else { - var sid = '<< <' + $('#explore-form input[type=text]').val() + '> <' + binding.col1.value + '> <' + binding.col2.value + '> >>'; + var sid = '<< ' + $('#explore-form input[type=text]').val() + ' <' + binding.col1.value + '> <' + binding.col2.value + '> >>'; } star = '<a href="' + buildExploreHash(sid) + '"><< * (' + star + ') >></a>'; } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |