|
From: <tob...@us...> - 2014-07-17 17:09:39
|
Revision: 8569
http://sourceforge.net/p/bigdata/code/8569
Author: tobycraig
Date: 2014-07-17 17:09:31 +0000 (Thu, 17 Jul 2014)
Log Message:
-----------
Improved explore tab to treat URIs without <> as namespaced only if they match one of the defined namespaces, allowing user to enter non-namespaced URIs without <>
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 15:46:25 UTC (rev 8568)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-17 17:09:31 UTC (rev 8569)
@@ -1171,8 +1171,15 @@
e.preventDefault();
var uri = $(this).find('input[type="text"]').val().trim();
if(uri) {
- // add < > if they're not present and this is not a namespaced URI
- if(uri[0] != '<' && uri.match(/^\w+:\//)) {
+ // add < > if they're not present and this is not a URI with a recognised namespace
+ var namespaces = [];
+ for(var cat in NAMESPACE_SHORTCUTS) {
+ for(var namespace in NAMESPACE_SHORTCUTS[cat]) {
+ namespaces.push(namespace);
+ }
+ }
+ var namespaced = '^(' + namespaces.join('|') + '):';
+ if(uri[0] != '<' && !uri.match(namespaced)) {
uri = '<' + uri;
if(uri.slice(-1) != '>') {
uri += '>';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|