|
From: <tob...@us...> - 2014-06-10 20:59:51
|
Revision: 8459
http://sourceforge.net/p/bigdata/code/8459
Author: tobycraig
Date: 2014-06-10 20:59:43 +0000 (Tue, 10 Jun 2014)
Log Message:
-----------
Fixed file drag & drop on update pane
Modified Paths:
--------------
branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js
Modified: branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js 2014-06-10 14:36:56 UTC (rev 8458)
+++ branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js 2014-06-10 20:59:43 UTC (rev 8459)
@@ -322,22 +322,28 @@
/* Update */
-function handleDragOver(e) {
+function handleDragOver(cm, e) {
e.stopPropagation();
e.preventDefault();
- e.originalEvent.dataTransfer.dropEffect = 'copy';
+ e.dataTransfer.dropEffect = 'copy';
}
-function handleFile(e) {
+function handleDrop(cm, e) {
e.stopPropagation();
e.preventDefault();
+ var files = e.dataTransfer.files;
+ handleFile(files);
+}
- if(e.type == 'drop') {
- var files = e.originalEvent.dataTransfer.files;
- } else {
- var files = e.originalEvent.target.files;
- }
-
+function handleFileInput(e) {
+ e.stopPropagation();
+ e.preventDefault();
+ var files = e.originalEvent.target.files;
+ handleFile(files);
+ $('#update-file').val('');
+}
+
+function handleFile(files) {
// only one file supported
if(files.length > 1) {
alert('Ignoring all but first file');
@@ -348,31 +354,29 @@
// if file is too large, tell user to supply local path
if(f.size > 1048576 * 100) {
alert('File too large, enter local path to file');
- $('#update-box').val('/path/to/' + f.name);
+ EDITORS.update.setValue('/path/to/' + f.name);
setType('path');
- $('#update-box').prop('disabled', false)
+ EDITORS.update.setOption('readOnly', false)
$('#large-file-message, #clear-file').hide();
} else {
var fr = new FileReader();
- fr.onload = function(e2) {
+ fr.onload = function(e) {
if(f.size > 10240) {
// do not use textarea
- $('#update-box').prop('disabled', true)
+ EDITORS.update.setOption('readOnly', true)
$('#filename').html(f.name);
$('#large-file-message, #clear-file').show()
- $('#update-box').val('');
- FILE_CONTENTS = e2.target.result;
+ EDITORS.update.setValue('');
+ FILE_CONTENTS = e.target.result;
} else {
// display file contents in the textarea
clearFile();
- $('#update-box').val(e2.target.result);
+ EDITORS.update.setValue(e.target.result);
}
- guessType(f.name.split('.').pop().toLowerCase(), e2.target.result);
+ guessType(f.name.split('.').pop().toLowerCase(), e.target.result);
};
fr.readAsText(f);
}
-
- $('#update-file').val('');
}
function clearFile(e) {
@@ -490,11 +494,11 @@
var sparql_update_commands = ['INSERT', 'DELETE', 'LOAD', 'CLEAR'];
-$('#update-file').change(handleFile);
-$('#update-box').on('dragover', handleDragOver)
- .on('drop', handleFile)
- .on('paste', handlePaste)
- .on('input propertychange', function() { $('#update-errors').hide(); });
+$('#update-file').change(handleFileInput);
+// $('#update-box').on('dragover', handleDragOver)
+// .on('drop', handleFile)
+// .on('paste', handlePaste)
+// .on('input propertychange', function() { $('#update-errors').hide(); });
$('#clear-file').click(clearFile);
$('#update-update').click(submitUpdate);
@@ -506,6 +510,9 @@
ERROR_CHARACTER_MARKERS.update.clear();
}
});
+EDITORS.update.on('dragover', handleDragOver);
+EDITORS.update.on('drop', handleDrop);
+EDITORS.update.on('paste', handlePaste);
EDITORS.update.addKeyMap({'Ctrl-Enter': submitUpdate});
function submitUpdate(e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-06-10 21:38:10
|
Revision: 8460
http://sourceforge.net/p/bigdata/code/8460
Author: tobycraig
Date: 2014-06-10 21:38:02 +0000 (Tue, 10 Jun 2014)
Log Message:
-----------
Fixed variable made global instead of local
Modified Paths:
--------------
branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js
Modified: branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js 2014-06-10 20:59:43 UTC (rev 8459)
+++ branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js 2014-06-10 21:38:02 UTC (rev 8460)
@@ -1179,7 +1179,7 @@
uri = '<' + uri + '>';
}
}
- output = escapeHTML(uri).replace(/\n/g, '<br>');
+ var output = escapeHTML(uri).replace(/\n/g, '<br>');
if(col.type == 'uri' || col.type == 'sid') {
output = '<a href="' + buildExploreHash(uri) + '">' + output + '</a>';
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tob...@us...> - 2014-06-10 22:02:56
|
Revision: 8461
http://sourceforge.net/p/bigdata/code/8461
Author: tobycraig
Date: 2014-06-10 22:02:47 +0000 (Tue, 10 Jun 2014)
Log Message:
-----------
Fixed namespace abbreviation of query results and added it to explore pane
Modified Paths:
--------------
branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js
Modified: branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js 2014-06-10 21:38:02 UTC (rev 8460)
+++ branches/WORKBENCH_QUERY_HISTORY/bigdata-war/src/html/js/workbench.js 2014-06-10 22:02:47 UTC (rev 8461)
@@ -1176,7 +1176,7 @@
} else {
var uri = col.value;
if(col.type == 'uri') {
- uri = '<' + uri + '>';
+ uri = abbreviate(uri);
}
}
var output = escapeHTML(uri).replace(/\n/g, '<br>');
@@ -1402,9 +1402,11 @@
}
function abbreviate(uri) {
- for(var ns in NAMESPACE_SHORTCUTS) {
- if(uri.indexOf(NAMESPACE_SHORTCUTS[ns]) == 0) {
- return uri.replace(NAMESPACE_SHORTCUTS[ns], ns + ':');
+ for(var nsGroup in NAMESPACE_SHORTCUTS) {
+ for(var ns in NAMESPACE_SHORTCUTS[nsGroup]) {
+ if(uri.indexOf(NAMESPACE_SHORTCUTS[nsGroup][ns]) == 0) {
+ return uri.replace(NAMESPACE_SHORTCUTS[nsGroup][ns], ns + ':');
+ }
}
}
return '<' + uri + '>';
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|