|
From: <tob...@us...> - 2014-07-03 17:37:38
|
Revision: 8522
http://sourceforge.net/p/bigdata/code/8522
Author: tobycraig
Date: 2014-07-03 17:37:27 +0000 (Thu, 03 Jul 2014)
Log Message:
-----------
Added query history delete, made queries obviously clickable
Modified Paths:
--------------
branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css
branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html
branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css 2014-07-03 10:21:20 UTC (rev 8521)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/css/style.css 2014-07-03 17:37:27 UTC (rev 8522)
@@ -327,6 +327,10 @@
border: 1px solid #e1e1e1;
}
+#query-history .query {
+ white-space: pre;
+}
+
#query-export-container {
text-align: right;
}
Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html
===================================================================
--- branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-03 10:21:20 UTC (rev 8521)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/index.html 2014-07-03 17:37:27 UTC (rev 8522)
@@ -140,9 +140,9 @@
<thead>
<tr>
<th>Time</th>
- <th>Namespace</th>
<th>Query</th>
<th>Results</th>
+ <th>Delete</th>
</tr>
</thead>
<tbody></tbody>
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-03 10:21:20 UTC (rev 8521)
+++ branches/BIGDATA_RELEASE_1_3_0/bigdata-war/src/html/js/workbench.js 2014-07-03 17:37:27 UTC (rev 8522)
@@ -652,14 +652,23 @@
});
EDITORS.query.addKeyMap({'Ctrl-Enter': submitQuery});
-$('#query-history').on('click', '.query', loadHistory);
+$('#query-history').on('click', '.query a', loadHistory);
+$('#query-history').on('click', '.query-delete a', deleteHistoryRow)
-function loadHistory() {
+function loadHistory(e) {
+ e.preventDefault();
EDITORS.query.setValue(this.innerText);
- useNamespace($(this).prev('.query-namespace').text());
EDITORS.query.focus();
}
+function deleteHistoryRow(e) {
+ e.preventDefault();
+ $(this).parents('tr').remove();
+ if($('#query-history tbody tr').length == 0) {
+ $('#query-history').hide();
+ }
+}
+
function submitQuery(e) {
try {
e.preventDefault();
@@ -669,8 +678,8 @@
EDITORS.query.save();
// do nothing if query is empty
- var query = $('#query-box').val().trim();
- if(query == '') {
+ var query = $('#query-box').val();
+ if(query.trim() == '') {
return;
}
@@ -693,11 +702,12 @@
// add this query to the history
var row = $('<tr>').prependTo($('#query-history tbody'));
row.append('<td class="query-time">' + new Date().toISOString() + '</td>');
- row.append('<td class="query-namespace">' + NAMESPACE + '</td>');
var cell = $('<td class="query">').appendTo(row);
- cell.text(query);
- cell.html(cell.html().replace('\n', '<br>'));
+ var a = $('<a href="#">').appendTo(cell);
+ a.text(query);
+ a.html(a.html().replace(/\n/g, '<br>'));
row.append('<td class="query-results">...</td>');
+ row.append('<td class="query-delete"><a href="#">X</a></td>')
}
$('#query-history').show();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|