|
From: <tob...@us...> - 2014-02-12 00:58:28
|
Revision: 7846
http://bigdata.svn.sourceforge.net/bigdata/?rev=7846&view=rev
Author: tobycraig
Date: 2014-02-12 00:58:18 +0000 (Wed, 12 Feb 2014)
Log Message:
-----------
Fixed drag & drop in Firefox by adding dragover handler
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-02-11 23:29:39 UTC (rev 7845)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-02-12 00:58:18 UTC (rev 7846)
@@ -1,3 +1,9 @@
+function handleDragOver(e) {
+ e.stopPropagation();
+ e.preventDefault();
+ e.originalEvent.dataTransfer.dropEffect = 'copy';
+}
+
function handleFile(e) {
e.stopPropagation();
e.preventDefault();
@@ -104,6 +110,7 @@
var sparql_update_commands = ['INSERT', 'DELETE'];
$('#mp-file').change(handleFile);
+$('#mp-box').on('dragover', handleDragOver);
$('#mp-box').on('drop', handleFile);
$('#mp-box').on('paste', handlePaste);
$('#mp-type').change(handleTypeChange);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-02-26 23:45:19
|
Revision: 7894
http://sourceforge.net/p/bigdata/code/7894
Author: tobycraig
Date: 2014-02-26 23:45:16 +0000 (Wed, 26 Feb 2014)
Log Message:
-----------
Make tab-switching shortcuts work within inputs too.
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-02-26 23:44:11 UTC (rev 7893)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-02-26 23:45:16 UTC (rev 7894)
@@ -39,8 +39,8 @@
}
// these should be , and . but Hotkeys views those keypresses as these characters
-$(document).bind('keydown', 'ctrl+¼', function() { moveTab(false); });
-$(document).bind('keydown', 'ctrl+¾', function() { moveTab(true); });
+$('html, textarea, select').bind('keydown', 'ctrl+¼', function() { moveTab(false); });
+$('html, textarea, select').bind('keydown', 'ctrl+¾', function() { moveTab(true); });
/* Namespaces */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-02-28 00:21:12
|
Revision: 7898
http://sourceforge.net/p/bigdata/code/7898
Author: tobycraig
Date: 2014-02-28 00:21:09 +0000 (Fri, 28 Feb 2014)
Log Message:
-----------
#820 - Allow HTTP[S] paths as well as file paths
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-02-27 23:42:09 UTC (rev 7897)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-02-28 00:21:09 UTC (rev 7898)
@@ -196,9 +196,15 @@
text = text.toUpperCase();
if(considerPath) {
- // match Unix or Windows paths
- var re = /^(((\/[^\/]+)+)|([A-Z]:([\\\/][^\\\/]+)+))$/;
- if(re.test(text.trim())) {
+ // match Unix, Windows or HTTP paths
+ // file:// is optional for local paths
+ // when file:// is not present, Windows paths may use \ or / and must include a :
+ // when file:// is present, Windows paths must use / and may include a :
+ // http[s]:// is mandatory for HTTP paths
+ var unix = /^(file:\/\/)?((\/[^\/]+)+)$/;
+ var windows = /^((file:\/\/)([A-Za-z]:?([\/][^\/\\]+)+))|([A-Za-z]:([\\\/][^\\\/]+)+)$/;
+ var http = /^https?:\/((\/[^\/]+)+)$/;
+ if(unix.test(text.trim()) || windows.test(text.trim()) || http.test(text.trim())) {
return 'path';
}
}
@@ -288,7 +294,11 @@
settings.contentType = rdf_content_types[type];
break;
case 'path':
- settings.data = 'uri=file://' + encodeURIComponent(settings.data);
+ // if no scheme is specified, assume a local path
+ if(!/^(file|(https?)):\/\//.test(settings.data)) {
+ settings.data = 'file://' + settings.data;
+ }
+ settings.data = 'uri=' + encodeURIComponent(settings.data);
break;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-02-28 18:57:47
|
Revision: 7901
http://sourceforge.net/p/bigdata/code/7901
Author: tobycraig
Date: 2014-02-28 18:57:43 +0000 (Fri, 28 Feb 2014)
Log Message:
-----------
#826 - Added submit load/query shortcut control return
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-02-28 18:42:27 UTC (rev 7900)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-02-28 18:57:43 UTC (rev 7901)
@@ -265,13 +265,18 @@
var sparql_update_commands = ['INSERT', 'DELETE'];
$('#load-file').change(handleFile);
-$('#load-box').on('dragover', handleDragOver);
-$('#load-box').on('drop', handleFile);
-$('#load-box').on('paste', handlePaste);
-$('#load-type').change(handleTypeChange);
+$('#load-box').on('dragover', handleDragOver)
+ .on('drop', handleFile)
+ .on('paste', handlePaste)
+ .bind('keydown', 'ctrl+return', submitLoad)
+ .change(handleTypeChange);
$('#clear-file').click(clearFile);
-$('#load-load').click(function() {
+$('#load-load').click(submitLoad);
+
+function submitLoad(e) {
+ e.preventDefault();
+
var settings = {
type: 'POST',
data: fileContents == null ? $('#load-box').val() : fileContents,
@@ -303,7 +308,7 @@
}
$.ajax(NAMESPACE_URL, settings);
-});
+}
$('#load-clear').click(function() {
$('#load-response').text('');
@@ -331,7 +336,12 @@
/* Query */
-$('#query-form').submit(function() {
+$('#query-box').bind('keydown', 'ctrl+return', function(e) { e.preventDefault(); $('#query-form').submit(); });
+$('#query-form').submit(submitQuery);
+
+function submitQuery(e) {
+ e.preventDefault();
+
var settings = {
type: 'POST',
data: $(this).serialize(),
@@ -356,10 +366,8 @@
} else {
$('#query-explanation').hide();
}
+}
- return false;
-});
-
$('#query-response-clear').click(function() {
$('#query-response, #query-explanation').empty('');
$('#query-explanation').hide();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-03-01 00:13:02
|
Revision: 7903
http://sourceforge.net/p/bigdata/code/7903
Author: tobycraig
Date: 2014-03-01 00:12:57 +0000 (Sat, 01 Mar 2014)
Log Message:
-----------
#830 - Output RDF data from CONSTRUCT query in table
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-02-28 19:56:28 UTC (rev 7902)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-01 00:12:57 UTC (rev 7903)
@@ -344,8 +344,7 @@
var settings = {
type: 'POST',
data: $(this).serialize(),
- dataType: 'json',
- accepts: {'json': 'application/sparql-results+json'},
+ headers: { 'Accept': 'application/sparql-results+json, application/rdf+xml' },
success: showQueryResults,
error: queryResultsError
}
@@ -375,21 +374,48 @@
function showQueryResults(data) {
$('#query-response').empty();
var table = $('<table>').appendTo($('#query-response'));
- var thead = $('<thead>').appendTo(table);
- var vars = [];
- var tr = $('<tr>');
- for(var i=0; i<data.head.vars.length; i++) {
- tr.append('<td>' + data.head.vars[i] + '</td>');
- vars.push(data.head.vars[i]);
- }
- thead.append(tr);
- table.append(thead);
- for(var i=0; i<data.results.bindings.length; i++) {
+ if(this.dataTypes[1] == 'xml') {
+ // RDF
+ table.append($('<thead><tr><td>s</td><td>p</td><td>o</td></tr></thead>'));
+ var rows = $(data).find('Description');
+ for(var i=0; i<rows.length; i++) {
+ // FIXME: are about and nodeID the only possible attributes here?
+ var s = rows[i].attributes['rdf:about'];
+ if(typeof(s) == 'undefined') {
+ s = rows[i].attributes['rdf:nodeID'];
+ }
+ s = s.textContent;
+ for(var j=0; j<rows[i].children.length; j++) {
+ var p = rows[i].children[j].tagName;
+ var o = rows[i].children[j].attributes['rdf:resource'];
+ // FIXME: is this the correct behaviour?
+ if(typeof(o) == 'undefined') {
+ o = rows[i].children[j].textContent;
+ } else {
+ o = o.textContent;
+ }
+ var tr = $('<tr><td>' + (j == 0 ? s : '') + '</td><td>' + p + '</td><td>' + o + '</td>');
+ table.append(tr);
+ }
+ }
+ } else {
+ // JSON
+ var thead = $('<thead>').appendTo(table);
+ var vars = [];
var tr = $('<tr>');
- for(var j=0; j<vars.length; j++) {
- tr.append('<td>' + data.results.bindings[i][vars[j]].value + '</td>');
+ for(var i=0; i<data.head.vars.length; i++) {
+ tr.append('<td>' + data.head.vars[i] + '</td>');
+ vars.push(data.head.vars[i]);
}
- table.append(tr);
+ thead.append(tr);
+ table.append(thead);
+ for(var i=0; i<data.results.bindings.length; i++) {
+ var tr = $('<tr>');
+ for(var j=0; j<vars.length; j++) {
+ tr.append('<td>' + data.results.bindings[i][vars[j]].value + '</td>');
+ }
+ table.append(tr);
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-03-01 01:38:19
|
Revision: 7904
http://sourceforge.net/p/bigdata/code/7904
Author: tobycraig
Date: 2014-03-01 01:38:15 +0000 (Sat, 01 Mar 2014)
Log Message:
-----------
#829 - Export query results to CSV
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-01 00:12:57 UTC (rev 7903)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-01 01:38:15 UTC (rev 7904)
@@ -371,6 +371,23 @@
$('#query-explanation').hide();
});
+$('#query-export').click(function() {
+ // FIXME: escape commas
+ var csv = '';
+ $('#query-response table tr').each(function(i, tr) {
+ $(tr).find('td').each(function(j, td) {
+ if(j > 0) {
+ csv += ',';
+ }
+ csv += td.textContent;
+ });
+ csv += '\n';
+ });
+ var uri = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
+ $('<a id="download-link" download="export.csv" href="' + uri + '">').appendTo('body')[0].click();
+ $('#download-link').remove();
+});
+
function showQueryResults(data) {
$('#query-response').empty();
var table = $('<table>').appendTo($('#query-response'));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-03-03 19:18:50
|
Revision: 7905
http://sourceforge.net/p/bigdata/code/7905
Author: tobycraig
Date: 2014-03-03 19:18:48 +0000 (Mon, 03 Mar 2014)
Log Message:
-----------
Fixed jQuery namespaced XML inconsistency between Chrome and Firefox
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-01 01:38:15 UTC (rev 7904)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-03 19:18:48 UTC (rev 7905)
@@ -90,8 +90,10 @@
function getDefaultNamespace() {
$.get('/sparql', function(data) {
- DEFAULT_NAMESPACE = $(data).find('Description[rdf\\:nodeID=defaultDataset]').find('title')[0].textContent;
- var url = $(data).find('Description[rdf\\:nodeID=defaultDataset]').find('sparqlEndpoint')[0].attributes['rdf:resource'].textContent;
+ // Chrome does not work with rdf\:Description, so look for Description too
+ var defaultDataset = $(data).find('rdf\\:Description[rdf\\:nodeID=defaultDataset], Description[rdf\\:nodeID=defaultDataset]');
+ DEFAULT_NAMESPACE = defaultDataset.find('title')[0].textContent;
+ var url = defaultDataset.find('sparqlEndpoint')[0].attributes['rdf:resource'].textContent;
useNamespace(DEFAULT_NAMESPACE, url);
getNamespaces();
});
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-03-04 19:12:21
|
Revision: 7907
http://sourceforge.net/p/bigdata/code/7907
Author: tobycraig
Date: 2014-03-04 19:12:18 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
Fixed error so that file:// and http[s]:// are correctly interpreted as paths
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 01:06:16 UTC (rev 7906)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:12:18 UTC (rev 7907)
@@ -194,8 +194,6 @@
}
function identify(text, considerPath) {
- text = text.toUpperCase();
-
if(considerPath) {
// match Unix, Windows or HTTP paths
// file:// is optional for local paths
@@ -210,6 +208,7 @@
}
}
+ text = text.toUpperCase();
for(var i=0; i<sparql_update_commands.length; i++) {
if(text.indexOf(sparql_update_commands[i]) != -1) {
return 'sparql';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-03-04 20:11:12
|
Revision: 7909
http://sourceforge.net/p/bigdata/code/7909
Author: tobycraig
Date: 2014-03-04 20:11:09 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
#829 - Added support for language for XML export
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 19:50:06 UTC (rev 7908)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 20:11:09 UTC (rev 7909)
@@ -416,7 +416,13 @@
} else {
dataType = '';
}
- xml += '\t\t\t<binding name="' + bindings[j] + '"><' + bindingType + dataType + '>' + td.textContent + '</' + bindingType + '></binding>\n';
+ var lang = $(td).data('lang');
+ if(lang) {
+ lang = ' xml:lang="' + lang + '"';
+ } else {
+ lang = '';
+ }
+ xml += '\t\t\t<binding name="' + bindings[j] + '"><' + bindingType + dataType + lang + '>' + td.textContent + '</' + bindingType + '></binding>\n';
});
xml += '\t\t</result>\n';
});
@@ -492,6 +498,9 @@
var tdData = ' class="literal" data-datatype="' + binding.datatype + '"';
} else {
var tdData = ' class="' + binding.type + '"';
+ if(binding['xml:lang']) {
+ tdData += ' data-lang="' + binding['xml:lang'] + '"';
+ }
}
tr.append('<td' + tdData + '>' + binding.value + '</td>');
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-03-04 22:43:06
|
Revision: 7912
http://sourceforge.net/p/bigdata/code/7912
Author: tobycraig
Date: 2014-03-04 22:43:01 +0000 (Tue, 04 Mar 2014)
Log Message:
-----------
#838 - Added support for boolean results from ASK queries
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/workbench.js
Modified: branches/RDR/bigdata-war/src/html/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 20:46:21 UTC (rev 7911)
+++ branches/RDR/bigdata-war/src/html/workbench.js 2014-03-04 22:43:01 UTC (rev 7912)
@@ -480,6 +480,11 @@
}
} else {
// JSON
+ if(typeof(data.boolean) != 'undefined') {
+ // ASK query
+ table.append('<tr><td>' + data.boolean + '</td></tr>').addClass('boolean');
+ return;
+ }
var thead = $('<thead>').appendTo(table);
var vars = [];
var tr = $('<tr>');
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|