|
From: <tob...@us...> - 2014-03-13 20:11:30
|
Revision: 7958
http://sourceforge.net/p/bigdata/code/7958
Author: tobycraig
Date: 2014-03-13 20:11:25 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
#827 - Split results up into separate sections
Modified Paths:
--------------
branches/RDR/bigdata-war/src/html/css/style.css
branches/RDR/bigdata-war/src/html/js/workbench.js
branches/RDR/bigdata-war/src/html/new.html
Modified: branches/RDR/bigdata-war/src/html/css/style.css
===================================================================
--- branches/RDR/bigdata-war/src/html/css/style.css 2014-03-13 16:57:19 UTC (rev 7957)
+++ branches/RDR/bigdata-war/src/html/css/style.css 2014-03-13 20:11:25 UTC (rev 7958)
@@ -59,6 +59,11 @@
margin-bottom: 10px;
}
+h2 {
+ font-size: 110%;
+ margin-bottom: 10px;
+}
+
#container {
/*max-width: 600px;*/
}
@@ -106,11 +111,9 @@
}
.box {
- border: 1px solid;
padding: 10px;
border: 1px solid;
border-bottom: none;
- min-height: 100px;
overflow-x: scroll;
}
@@ -168,7 +171,7 @@
text-align: right;
}
-#advanced-features, #query-explanation {
+#advanced-features, #query-explanation, #explore-results, #namespace-properties {
display: none;
}
@@ -180,7 +183,3 @@
pre {
font-family: monospace;
}
-
-#namespace-properties {
- display: none;
-}
Modified: branches/RDR/bigdata-war/src/html/js/workbench.js
===================================================================
--- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-13 16:57:19 UTC (rev 7957)
+++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-03-13 20:11:25 UTC (rev 7958)
@@ -673,16 +673,18 @@
}
function updateExploreStart(data) {
- var disp = $('#explore-results');
- disp.html('');
+ var results = data.results.bindings.length > 0;
+ $('#explore-results').toggle(results);
+ $('#explore-no-results').toggle(!results);
+
// see if we got any results
- if(data.results.bindings.length == 0) {
- disp.append('No vertex found!');
+ if(!results) {
+ $('#explore-no-results').html('<h1>No results found!</h1>');
return;
}
var vertex = data.results.bindings[0].vertex;
- disp.append('<h3>' + vertex.value + '</h3>');
+ $('#explore-header h1').text(vertex.value);
var outbound=[], inbound=[], attributes=[];
for(var i=0; i<data.results.bindings.length; i++) {
var binding = data.results.bindings[i];
@@ -698,33 +700,45 @@
}
}
+ var outgoingContainer = $('#explore-outgoing');
+ outgoingContainer.html('');
if(outbound.length) {
- disp.append('<h4>Outbound links</h4>');
- var table = $('<table>').appendTo(disp);
+ outgoingContainer.append('<h2>Outgoing links</h2>');
+ var table = $('<table>').appendTo(outgoingContainer);
for(var i=0; i<outbound.length; i++) {
var linkAttributes = outbound[i].sidP.value + ': ' + outbound[i].sidO.value;
table.append('<tr><td>' + outbound[i].p.value + '</td><td><a href="#">' + outbound[i].o.value + '</a></td><td>' + linkAttributes + '</td></tr>');
}
+ } else {
+ outgoingContainer.append('<h2>No outgoing links</h2>');
}
+ var incomingContainer = $('#explore-incoming');
+ incomingContainer.html('');
if(inbound.length) {
- disp.append('<h4>Inbound links</h4>');
- var table = $('<table>').appendTo(disp);
+ incomingContainer.append('<h2>Inbound links</h2>');
+ var table = $('<table>').appendTo(incomingContainer);
for(var i=0; i<inbound.length; i++) {
var linkAttributes = inbound[i].sidP.value + ': ' + inbound[i].sidO.value;
table.append('<tr><td><a href="#">' + inbound[i].s.value + '</a></td><td>' + inbound[i].p.value + '</td><td>' + linkAttributes + '</td></tr>');
}
+ } else {
+ incomingContainer.append('<h2>No incoming links</h2>');
}
+ var attributesContainer = $('#explore-attributes');
+ attributesContainer.html('');
if(attributes.length) {
- disp.append('<h4>Attributes</h4>');
- var table = $('<table>').appendTo(disp);
+ attributesContainer.append('<h4>Attributes</h4>');
+ var table = $('<table>').appendTo(attributesContainer);
for(var i=0; i<attributes.length; i++) {
table.append('<tr><td>' + attributes[i].p.value + '</td><td>' + attributes[i].o.value + '</td></tr>');
}
+ } else {
+ attributesContainer.append('<h2>No attributes</h2>');
}
- disp.find('a').click(function(e) { e.preventDefault(); loadURI(this.text); });
+ $('#explore-results a').click(function(e) { e.preventDefault(); loadURI(this.text); });
}
function updateExploreError(jqXHR, textStatus, errorThrown) {
Modified: branches/RDR/bigdata-war/src/html/new.html
===================================================================
--- branches/RDR/bigdata-war/src/html/new.html 2014-03-13 16:57:19 UTC (rev 7957)
+++ branches/RDR/bigdata-war/src/html/new.html 2014-03-13 20:11:25 UTC (rev 7958)
@@ -143,8 +143,15 @@
<p>Enter a URI to begin navigation <form id="explore-form"><input type="text"> <input type="submit"></form></p>
</div>
- <div class="box" id="explore-results">
+ <div id="explore-results">
+ <div class="box" id="explore-header"><h1></h1></div>
+ <div class="box" id="explore-incoming"></div>
+ <div class="box" id="explore-outgoing"></div>
+ <div class="box" id="explore-attributes"></div>
</div>
+
+ <div class="box" id="explore-no-results"></div>
+
</div>
<div class="tab" id="status-tab">
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|