From: <tob...@us...> - 2014-04-02 22:43:08
|
Revision: 8030 http://sourceforge.net/p/bigdata/code/8030 Author: tobycraig Date: 2014-04-02 22:43:05 +0000 (Wed, 02 Apr 2014) Log Message: ----------- #843 - Show query details upon request and update overall numbers too when a query's details are requested Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-02 20:53:52 UTC (rev 8029) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-02 22:43:05 UTC (rev 8030) @@ -209,5 +209,6 @@ #running-queries div.query-details { border-bottom: 1px solid; + overflow-x: scroll; } Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-02 20:53:52 UTC (rev 8029) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-02 22:43:05 UTC (rev 8030) @@ -811,7 +811,20 @@ $('#show-queries').click(function(e) { e.preventDefault(); - $.get('/bigdata/status?showQueries', function(data) { + showQueries(false); +}); + +$('#show-query-details').click(function(e) { + e.preventDefault(); + showQueries(true); +}); + +function showQueries(details) { + var url = '/bigdata/status?showQueries'; + if(details) { + url += '=details'; + } + $.get(url, function(data) { // get data inside a jQuery object data = $('<div>').append(data); @@ -822,7 +835,6 @@ $('#running-queries').empty(); data.find('h1').each(function(i, e) { - // per running query, data is structured h1 form (with numbers/cancel data) h2 pre (with SPARQL) e = $(e); // get numbers string, which includes cancel link var form = e.next(); @@ -832,18 +844,25 @@ // get query id var queryId = form.find('input[type=hidden]').val(); // get SPARQL - var sparql = form.next().next().html(); + var sparqlContainer = form.next().next(); + var sparql = sparqlContainer.html(); + if(details) { + var queryDetails = $('<div>').append(sparqlContainer.nextUntil('h1')).html(); + } else { + var queryDetails = '<a href="#">Details</a>'; + } + // got all data, create a li for each query - var li = $('<li><div class="query"><pre>' + sparql + '</pre></div><div class="query-numbers">' + numbers + ', <a href="#" class="cancel-query">Cancel</a></div><div class="query-details"><a href="#" class="query-details collapsed">Details</a></div>'); + var li = $('<li><div class="query"><pre>' + sparql + '</pre></div><div class="query-numbers">' + numbers + ', <a href="#" class="cancel-query">Cancel</a></div><div class="query-details">' + queryDetails + '</div>'); li.find('a').data('queryId', queryId); $('#running-queries').append(li); }); $('.cancel-query').click(cancelQuery); - $('a.query-details').click(getQueryDetails); + $('.query-details a').click(getQueryDetails); }); -}); +} function cancelQuery(e) { e.preventDefault(); @@ -854,8 +873,27 @@ } } -function getQueryDetails(e) {} +function getQueryDetails(e) { + e.preventDefault(); + var id = $(this).data('queryId'); + $.ajax({url: '/bigdata/status?showQueries=details&queryId=' + id, + success: function(data) { + // get data inside a jQuery object + data = $('<div>').append(data); + // update status numbers + getStatusNumbers(data); + + // details begin after second pre + var details = $('<div>').append($(data.find('pre')[1]).nextAll()).html(); + + $(this).parent().html(details); + }, + context: this + }); +} + + /* Performance */ $('#tab-selector a[data-target=performance]').click(function(e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-05 00:35:12
|
Revision: 8056 http://sourceforge.net/p/bigdata/code/8056 Author: tobycraig Date: 2014-04-05 00:35:08 +0000 (Sat, 05 Apr 2014) Log Message: ----------- Changed new workbench to default. Old one is available at /bigdata/html/old.html. Also made query tab default instead of load in new workbench. Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html Added Paths: ----------- branches/RDR/bigdata-war/src/html/old.html Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-04 19:56:42 UTC (rev 8055) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-05 00:35:08 UTC (rev 8056) @@ -1,144 +1,201 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" -"http://www.w3.org/TR/html4/loose.dtd"> -<html> -<head profile="http://www.w3.org/2005/10/profile"> -<link rel="icon" - type="image/png" - href="/bigdata/html/favicon.ico" /> -<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > -<title>bigdata® NanoSparqlServer</title> -<!-- $Id$ --> -<!-- junit test marker: index.html --> -</head> -<body> - -<h2>Welcome to bigdata®.</h2> -<p>Please consult the -<a href="http://wiki.bigdata.com/wiki/index.php/NanoSparqlServer" - target="_blank" - > documentation</a> for information on using the NanoSparqlServer's REST Api. </br>See the - <a href="http://wiki.bigdata.com/wiki/index.php/Main_Page" - target="_blank" - >wiki</a> for help on query optimization, bigdata SPARQL extensions, etc. -</p> - -<p> -The following URLs should be active when deployed in the default configuration: -</p> -<dl> -<dt>http://hostname:port/bigdata</dt> -<dd>This page.</dd> -<dt>http://hostname:port/bigdata/sparql</dt> -<dd>The SPARQL REST API (<a href="/bigdata/sparql">Service Description + VoID Description</a>).</dd> -<dt>http://hostname:port/bigdata/namespace</dt> -<dd>VoID <a href="/bigdata/namespace">graph of available KBs</a> from this service.</dd> -<dt>http://hostname:port/bigdata/status</dt> -<dd>A <a href="/bigdata/status">status</a> page.</dd> -<dt>http://hostname:port/bigdata/counters</dt> -<dd>A <a href="/bigdata/counters"> performance counters</a> page.</dd> -</dl> - -<p> -Where <i>hostname</i> is the name of this host and <i>port</i> is the port at -which this page was accessed. -</p> - -<!-- Note: Some applications (firefox 7) can not handle a GET with a very long - URL. For that reason ONLY this operation defaults to a POST. You SHOULD - use GET for database queries since they are, by and large, idempotent. - --> -<h2><a href="http://www.w3.org/TR/sparql11-query/" - title="W3C SPARQL 1.1 Query Recommendation" - target="_blank" - > SPARQL Query </a></h2> -<FORM action="/bigdata/sparql" method="post" name="QUERY"> - <P> - <TEXTAREA name="query" rows="10" cols="80" title="Enter SPARQL Query." - >SELECT * { ?s ?p ?o } LIMIT 1</TEXTAREA> - </P><P> - Tenant Namespace - <INPUT type="text" name="namespace" title="Tenant namespace." - > (leave empty for default KB) - </P><P> - <INPUT type="submit" value="Send" title="Submit query."> - <INPUT type="checkbox" name="explain" value="true" - title="Explain query plan rather than returning the query results." - > Explain - (<INPUT type="checkbox" name="explain" value="details" - title="Explain query plan rather than returning the query results (with extra details)." - > Details) - <INPUT type="checkbox" name="analytic" value="true" - title="Enable the analytic query package." - > Analytic -<!-- TODO Uncomment to reveal the RTO option. --> - <INPUT type="checkbox" name="RTO" value="true" - title="Enable the Runtime Query Optimizer (RTO) - This is an alpha feature." - > RTO (Alpha) -<!-- --> - <INPUT type="checkbox" name="xhtml" value="true" - title="Request XHTML response (results formatted as table)." - checked="checked" - > XHTML - </P> -</FORM> -<h2><a href="http://www.w3.org/TR/sparql11-update/" - title="W3C SPARQL Update Recommendation" - target="_blank" - >SPARQL Update</a></h2> -<FORM action="/bigdata/sparql" method="post"> - <P> - <TEXTAREA name="update" rows="10" cols="80" title="Enter SPARQL Update." - > -PREFIX dc: <http://purl.org/dc/elements/1.1/> -INSERT DATA -{ - <http://example/book1> dc:title "A new book" ; - dc:creator "A.N.Other" . -}</TEXTAREA> - </P><P> - Tenant Namespace - <INPUT type="text" name="namespace" title="Tenant namespace." - > (leave empty for default KB) - </P><P> - <INPUT type="submit" value="Send" title="Submit Update."> - <!--INPUT type="checkbox" name="explain" value="true" - title="Explain query plan rather than returning the query results." - > Explain--> - <INPUT type="checkbox" name="analytic" value="true" - title="Enable the analytic query package." - > Analytic - <INPUT type="checkbox" name="monitor" value="true" - title="Monitor the execution of the UPDATE request." - checked="checked" - > Monitor - </P> -</FORM> -<p> -<!-- Note: Some common characters need to be escaped here and also in the SPARQL - examples above. - --> -Here are some useful namespaces: -</p> -<pre> -prefix dc: <http://purl.org/dc/elements/1.1/> -prefix xsd: <http://www.w3.org/2001/XMLSchema#> -prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> -prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> -prefix owl: <http://www.w3.org/2002/07/owl#> -prefix foaf: <http://xmlns.com/foaf/0.1/> -prefix hint: <http://www.bigdata.com/queryHints#> -prefix bd: <http://www.bigdata.com/rdf#> -prefix bds: <http://www.bigdata.com/rdf/search#> -</pre> -<!-- Note: Use SPARQL Update "LOAD" instead. -<h2>Upload Data (URL):</h2> -<form action="sparql" method="post"> - <p> - <textarea name="uri" rows="1" cols="100">file:/</textarea> - </p><p> - <input type="submit" value="Upload"> - </p> -</form> ---> -</body> -</html> \ No newline at end of file +<!DOCTYPE html> +<html lang="en"> + <head profile="http://www.w3.org/2005/10/profile"> + <link rel="icon" + type="image/png" + href="/bigdata/html/favicon.ico" /> + <!-- meta charset="utf-8" --> + <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > + <title>Bigdata Workbench</title> + <link rel="stylesheet" href="/bigdata/html/css/style.css"> + </head> + + <body> + <div id="container"> + + <div id="top"> + <img src="/bigdata/html/images/logo.png" id="logo"> + <form id="search-form"><label for="search-text">Search:</label> <input type="text" id="search-text"></form> + <p>Current namespace: <span id="current-namespace"></span></p> + </div> + + <div id="tab-selector"> + <a data-target="query" class="active">Query</a> + <a data-target="load">Load</a> + <a data-target="explore">Explore</a> + <a data-target="status">Status</a> + <a data-target="performance">Performance</a> + <a data-target="namespaces">Namespaces</a> + </div> + + <div class="tab" id="load-tab"> + + <div class="box"> + + <div class="namespace-shortcuts"> + <ul> + <li data-ns="prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>">RDF</li> + <li data-ns="prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>">RDFS</li> + <li data-ns="prefix owl: <http://www.w3.org/2002/07/owl#>">OWL</li> + <li data-ns="prefix bd: <http://www.bigdata.com/rdf#> ">BD</li> + <li data-ns="prefix bds: <http://www.bigdata.com/rdf/search#> ">BDS</li> + <li data-ns="prefix foaf: <http://xmlns.com/foaf/0.1/>">FOAF</li> + <li data-ns="prefix hint: <http://www.bigdata.com/queryHints#>">HINT</li> + <li data-ns="prefix dc: <http://purl.org/dc/elements/1.1/>">DC</li> + <li data-ns="prefix xsd: <http://www.w3.org/2001/XMLSchema#>">XSD</li> + </ul> + </div> + + <textarea id="load-box" placeholder="(Type in or drag a file containing RDF data, a SPARQL update or a file path or URL)"></textarea> + <p id="large-file-message">Your file is too large to display here, but will be uploaded as normal. <a href="#" id="clear-file">Remove file</a></p> + <p> + <input type="file" id="load-file"><br> + <label for="load-type">Type:</label> + <select id="load-type"> + <option value="sparql" selected="selected">SPARQL</option> + <option value="rdf">RDF</option> + <option value="path">File path</option> + </select> + <span id="rdf-type-container"> + <label for="rdf-type">Format:</label> + <select id="rdf-type"> + <option value="">Select RDF format</option> + <option value="n-quads">N-Quads</option> + <option value="n-triples">N-Triples</option> + <option value="n3">Notation3</option> + <option value="rdf/xml">RDF/XML</option> + <option value="trig">TriG</option> + <option value="trix">TriX</option> + <option value="turtle">Turtle</option> + </select> + </span> + </p> + <hr class="shadow"> + <button id="load-load">Load</button> + </div> + + <div class="box"> + <pre id="load-response"></pre> + </div> + + <div class="bottom"> + <button id="load-clear">Clear output</button> + </div> + + </div> + + <div class="tab" id="query-tab"> + <div class="box"> + + <div class="namespace-shortcuts"> + <ul> + <li data-ns="prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>">RDF</li> + <li data-ns="prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>">RDFS</li> + <li data-ns="prefix owl: <http://www.w3.org/2002/07/owl#>">OWL</li> + <li data-ns="prefix bd: <http://www.bigdata.com/rdf#> ">BD</li> + <li data-ns="prefix bds: <http://www.bigdata.com/rdf/search#> ">BDS</li> + <li data-ns="prefix foaf: <http://xmlns.com/foaf/0.1/>">FOAF</li> + <li data-ns="prefix hint: <http://www.bigdata.com/queryHints#>">HINT</li> + <li data-ns="prefix dc: <http://purl.org/dc/elements/1.1/>">DC</li> + <li data-ns="prefix xsd: <http://www.w3.org/2001/XMLSchema#>">XSD</li> + </ul> + </div> + + <form id="query-form"> + <textarea id="query-box" name="query" placeholder="(Input a SPARQL query)"></textarea> + + <a href="#" id="advanced-features-toggle">Advanced features</a> + + <div id="advanced-features"> + <input type="checkbox" id="query-explain"> <label for="query-explain">Explain</label> + <input type="checkbox" name="analytic" value="true" id="query-analytic"> <label for="query-analytic">Analytic</label> + <input type="checkbox" name="RTO" value="true" id="query-rto"> <label for="query-rto">Runtime Query Optimizer</label> + </div> + + <hr class="shadow"> + + <div id="load-buttons"> + <input type="submit" value="Execute"> + <input type="reset" value="Clear"> + </div> + </form> + + </div> + + <div id="query-response" class="box"> + </div> + + <div id="query-explanation" class="box"> + </div> + + <div class="bottom"> + <button id="query-export-csv">Export CSV</button> + <button id="query-export-json">Export JSON</button> + <button id="query-export-xml">Export XML</button> + <button id="query-response-clear">Clear</button> + </div> + + </div> + + <div class="tab" id="explore-tab"> + + <div class="box"> + <p>Enter a URI to begin navigation <form id="explore-form"><input type="text"> <input type="submit"></form></p> + </div> + + <div id="explore-results"> + <div class="box" id="explore-header"></div> + <div class="box" id="explore-incoming"></div> + <div class="box" id="explore-outgoing"></div> + <div class="box" id="explore-attributes"></div> + </div> + + </div> + + <div class="tab" id="status-tab"> + + <div class="box"> + <p>Accepted query count: <span id="accepted-query-count"></span></p> + <p>Running query count: <span id="running-query-count"></span></p> + <p>Show <a href="#" id="show-queries">queries</a>, <a href="#" id="show-query-details">query details</a>.</p> + <pre id="status-numbers"></pre> + <ul id="running-queries"></ul> + </div> + + </div> + + <div class="tab" id="performance-tab"> + + <div class="box"></div> + + </div> + + <div class="tab" id="namespaces-tab"> + + <div class="box"> + <h1>Namespaces</h1> + <ul id="namespaces-list"></ul> + <br> + <a href="/bigdata/namespace">Download VoID description of all namespaces</a> + </div> + + <div id="namespace-properties" class="box"> + <h1></h1> + <table></table> + </div> + + <div class="box"> + <form id="namespace-create"><input type="text"> <input type="submit" value="Create namespace"></form> + </div> + + </div> + + </div> + + <!--[if IE]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> + <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> + <script>window.jQuery || document.write('<script src="/bigdata/html/js/vendor/jquery.min.js"><\/script>')</script> + <script src="/bigdata/html/js/vendor/jquery.hotkeys.js"></script> + <script src="/bigdata/html/js/workbench.js"></script> + </body> +</html> Copied: branches/RDR/bigdata-war/src/html/old.html (from rev 8028, branches/RDR/bigdata-war/src/html/index.html) =================================================================== --- branches/RDR/bigdata-war/src/html/old.html (rev 0) +++ branches/RDR/bigdata-war/src/html/old.html 2014-04-05 00:35:08 UTC (rev 8056) @@ -0,0 +1,144 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" +"http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head profile="http://www.w3.org/2005/10/profile"> +<link rel="icon" + type="image/png" + href="/bigdata/html/favicon.ico" /> +<meta http-equiv="Content-Type" content="text/html;charset=utf-8" > +<title>bigdata® NanoSparqlServer</title> +<!-- $Id$ --> +<!-- junit test marker: index.html --> +</head> +<body> + +<h2>Welcome to bigdata®.</h2> +<p>Please consult the +<a href="http://wiki.bigdata.com/wiki/index.php/NanoSparqlServer" + target="_blank" + > documentation</a> for information on using the NanoSparqlServer's REST Api. </br>See the + <a href="http://wiki.bigdata.com/wiki/index.php/Main_Page" + target="_blank" + >wiki</a> for help on query optimization, bigdata SPARQL extensions, etc. +</p> + +<p> +The following URLs should be active when deployed in the default configuration: +</p> +<dl> +<dt>http://hostname:port/bigdata</dt> +<dd>This page.</dd> +<dt>http://hostname:port/bigdata/sparql</dt> +<dd>The SPARQL REST API (<a href="/bigdata/sparql">Service Description + VoID Description</a>).</dd> +<dt>http://hostname:port/bigdata/namespace</dt> +<dd>VoID <a href="/bigdata/namespace">graph of available KBs</a> from this service.</dd> +<dt>http://hostname:port/bigdata/status</dt> +<dd>A <a href="/bigdata/status">status</a> page.</dd> +<dt>http://hostname:port/bigdata/counters</dt> +<dd>A <a href="/bigdata/counters"> performance counters</a> page.</dd> +</dl> + +<p> +Where <i>hostname</i> is the name of this host and <i>port</i> is the port at +which this page was accessed. +</p> + +<!-- Note: Some applications (firefox 7) can not handle a GET with a very long + URL. For that reason ONLY this operation defaults to a POST. You SHOULD + use GET for database queries since they are, by and large, idempotent. + --> +<h2><a href="http://www.w3.org/TR/sparql11-query/" + title="W3C SPARQL 1.1 Query Recommendation" + target="_blank" + > SPARQL Query </a></h2> +<FORM action="/bigdata/sparql" method="post" name="QUERY"> + <P> + <TEXTAREA name="query" rows="10" cols="80" title="Enter SPARQL Query." + >SELECT * { ?s ?p ?o } LIMIT 1</TEXTAREA> + </P><P> + Tenant Namespace + <INPUT type="text" name="namespace" title="Tenant namespace." + > (leave empty for default KB) + </P><P> + <INPUT type="submit" value="Send" title="Submit query."> + <INPUT type="checkbox" name="explain" value="true" + title="Explain query plan rather than returning the query results." + > Explain + (<INPUT type="checkbox" name="explain" value="details" + title="Explain query plan rather than returning the query results (with extra details)." + > Details) + <INPUT type="checkbox" name="analytic" value="true" + title="Enable the analytic query package." + > Analytic +<!-- TODO Uncomment to reveal the RTO option. --> + <INPUT type="checkbox" name="RTO" value="true" + title="Enable the Runtime Query Optimizer (RTO) - This is an alpha feature." + > RTO (Alpha) +<!-- --> + <INPUT type="checkbox" name="xhtml" value="true" + title="Request XHTML response (results formatted as table)." + checked="checked" + > XHTML + </P> +</FORM> +<h2><a href="http://www.w3.org/TR/sparql11-update/" + title="W3C SPARQL Update Recommendation" + target="_blank" + >SPARQL Update</a></h2> +<FORM action="/bigdata/sparql" method="post"> + <P> + <TEXTAREA name="update" rows="10" cols="80" title="Enter SPARQL Update." + > +PREFIX dc: <http://purl.org/dc/elements/1.1/> +INSERT DATA +{ + <http://example/book1> dc:title "A new book" ; + dc:creator "A.N.Other" . +}</TEXTAREA> + </P><P> + Tenant Namespace + <INPUT type="text" name="namespace" title="Tenant namespace." + > (leave empty for default KB) + </P><P> + <INPUT type="submit" value="Send" title="Submit Update."> + <!--INPUT type="checkbox" name="explain" value="true" + title="Explain query plan rather than returning the query results." + > Explain--> + <INPUT type="checkbox" name="analytic" value="true" + title="Enable the analytic query package." + > Analytic + <INPUT type="checkbox" name="monitor" value="true" + title="Monitor the execution of the UPDATE request." + checked="checked" + > Monitor + </P> +</FORM> +<p> +<!-- Note: Some common characters need to be escaped here and also in the SPARQL + examples above. + --> +Here are some useful namespaces: +</p> +<pre> +prefix dc: <http://purl.org/dc/elements/1.1/> +prefix xsd: <http://www.w3.org/2001/XMLSchema#> +prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> +prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> +prefix owl: <http://www.w3.org/2002/07/owl#> +prefix foaf: <http://xmlns.com/foaf/0.1/> +prefix hint: <http://www.bigdata.com/queryHints#> +prefix bd: <http://www.bigdata.com/rdf#> +prefix bds: <http://www.bigdata.com/rdf/search#> +</pre> +<!-- Note: Use SPARQL Update "LOAD" instead. +<h2>Upload Data (URL):</h2> +<form action="sparql" method="post"> + <p> + <textarea name="uri" rows="1" cols="100">file:/</textarea> + </p><p> + <input type="submit" value="Upload"> + </p> +</form> +--> +</body> +</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-07 20:40:46
|
Revision: 8077 http://sourceforge.net/p/bigdata/code/8077 Author: tobycraig Date: 2014-04-07 20:40:41 +0000 (Mon, 07 Apr 2014) Log Message: ----------- #878 - Hide output box on query/load/explore pages until it has content Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-07 20:33:31 UTC (rev 8076) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-07 20:40:41 UTC (rev 8077) @@ -179,7 +179,7 @@ border: none; } -#advanced-features, #query-explanation, #namespace-properties { +#advanced-features, #query-response, #query-explanation, #query-tab .bottom *, #load-response, #load-clear, #explore-results, #namespace-properties { display: none; } Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-07 20:33:31 UTC (rev 8076) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-07 20:40:41 UTC (rev 8077) @@ -75,8 +75,8 @@ <button id="load-load">Load</button> </div> - <div class="box"> - <pre id="load-response"></pre> + <div class="box" id="load-response"> + <pre></pre> </div> <div class="bottom"> @@ -151,6 +151,8 @@ <div class="box" id="explore-attributes"></div> </div> + <div class="bottom"></div> + </div> <div class="tab" id="status-tab"> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-07 20:33:31 UTC (rev 8076) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-07 20:40:41 UTC (rev 8077) @@ -382,7 +382,8 @@ } $('#load-clear').click(function() { - $('#load-response').text(''); + $('#load-response, #load-clear').hide(); + $('#load-response pre').text(''); }); $('#advanced-features-toggle').click(function() { @@ -391,17 +392,20 @@ }); function updateResponseHTML(data) { - $('#load-response').html(data); + $('#load-response, #load-clear').show(); + $('#load-response pre').html(data); } function updateResponseXML(data) { var modified = data.childNodes[0].attributes['modified'].value; var milliseconds = data.childNodes[0].attributes['milliseconds'].value; - $('#load-response').text('Modified: ' + modified + '\nMilliseconds: ' + milliseconds); + $('#load-response, #load-clear').show(); + $('#load-response pre').text('Modified: ' + modified + '\nMilliseconds: ' + milliseconds); } function updateResponseError(jqXHR, textStatus, errorThrown) { - $('#load-response').text('Error! ' + textStatus + ' ' + errorThrown); + $('#load-response, #load-clear').show(); + $('#load-response pre').text('Error! ' + textStatus + ' ' + errorThrown); } @@ -440,7 +444,7 @@ $('#query-response-clear').click(function() { $('#query-response, #query-explanation').empty(''); - $('#query-explanation').hide(); + $('#query-response, #query-explanation, #query-tab .bottom *').hide(); }); $('#query-export-csv').click(exportCSV); @@ -543,6 +547,7 @@ function showQueryResults(data) { $('#query-response').empty(); + $('#query-response, #query-tab .bottom *').show(); var table = $('<table>').appendTo($('#query-response')); if(this.dataTypes[1] == 'xml') { // RDF @@ -627,6 +632,7 @@ } function queryResultsError(jqXHR, textStatus, errorThrown) { + $('#query-response, #query-tab .bottom *').show(); $('#query-response').text('Error! ' + textStatus + ' ' + errorThrown); } @@ -724,6 +730,8 @@ // clear tables $('#explore-incoming, #explore-outgoing, #explore-attributes').html('<table>'); + $('#explore-tab .bottom').hide(); + $('#explore-results, #explore-results .box').show(); // go through each binding, adding it to the appropriate table $.each(data.results.bindings, function(i, binding) { @@ -823,8 +831,10 @@ }); function updateExploreError(jqXHR, textStatus, errorThrown) { - $('#explore-results .box').html(''); - $('#explore-header').html('Error! ' + textStatus + ' ' + errorThrown); + $('#explore-tab .bottom').show(); + $('#explore-results .box').html('').hide(); + $('#explore-header').text('Error! ' + textStatus + ' ' + errorThrown); + $('#explore-results, #explore-header').show(); } /* Status */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-07 23:57:44
|
Revision: 8082 http://sourceforge.net/p/bigdata/code/8082 Author: tobycraig Date: 2014-04-07 23:57:41 +0000 (Mon, 07 Apr 2014) Log Message: ----------- #882 - Abbreviate URIs belonging to a common namespace Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-07 22:52:33 UTC (rev 8081) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-07 23:57:41 UTC (rev 8082) @@ -34,17 +34,6 @@ <div class="box"> <div class="namespace-shortcuts"> - <ul> - <li data-ns="prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>">RDF</li> - <li data-ns="prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>">RDFS</li> - <li data-ns="prefix owl: <http://www.w3.org/2002/07/owl#>">OWL</li> - <li data-ns="prefix bd: <http://www.bigdata.com/rdf#> ">BD</li> - <li data-ns="prefix bds: <http://www.bigdata.com/rdf/search#> ">BDS</li> - <li data-ns="prefix foaf: <http://xmlns.com/foaf/0.1/>">FOAF</li> - <li data-ns="prefix hint: <http://www.bigdata.com/queryHints#>">HINT</li> - <li data-ns="prefix dc: <http://purl.org/dc/elements/1.1/>">DC</li> - <li data-ns="prefix xsd: <http://www.w3.org/2001/XMLSchema#>">XSD</li> - </ul> </div> <textarea id="load-box" placeholder="(Type in or drag a file containing RDF data, a SPARQL update or a file path or URL)"></textarea> @@ -89,17 +78,6 @@ <div class="box"> <div class="namespace-shortcuts"> - <ul> - <li data-ns="prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>">RDF</li> - <li data-ns="prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>">RDFS</li> - <li data-ns="prefix owl: <http://www.w3.org/2002/07/owl#>">OWL</li> - <li data-ns="prefix bd: <http://www.bigdata.com/rdf#> ">BD</li> - <li data-ns="prefix bds: <http://www.bigdata.com/rdf/search#> ">BDS</li> - <li data-ns="prefix foaf: <http://xmlns.com/foaf/0.1/>">FOAF</li> - <li data-ns="prefix hint: <http://www.bigdata.com/queryHints#>">HINT</li> - <li data-ns="prefix dc: <http://purl.org/dc/elements/1.1/>">DC</li> - <li data-ns="prefix xsd: <http://www.w3.org/2001/XMLSchema#>">XSD</li> - </ul> </div> <form id="query-form"> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-07 22:52:33 UTC (rev 8081) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-07 23:57:41 UTC (rev 8082) @@ -20,12 +20,12 @@ showTab($(this).data('target')); }); -function showTab(tab) { +function showTab(tab, nohash) { $('.tab').hide(); $('#' + tab + '-tab').show(); $('#tab-selector a').removeClass(); $('a[data-target=' + tab + ']').addClass('active'); - if(window.location.hash.substring(1).indexOf(tab) != 0) { + if(!nohash && window.location.hash.substring(1).indexOf(tab) != 0) { window.location.hash = tab; } } @@ -169,13 +169,30 @@ useNamespace(DEFAULT_NAMESPACE, url); }); } -var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, fileContents; +var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, fileContents, NAMESPACE_SHORTCUTS; getDefaultNamespace(); /* Namespace shortcuts */ +NAMESPACE_SHORTCUTS = { + 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', + 'rdfs': 'http://www.w3.org/2000/01/rdf-schema#', + 'owl': 'http://www.w3.org/2002/07/owl#', + 'bd': 'http://www.bigdata.com/rdf#', + 'bds': 'http://www.bigdata.com/rdf/search#', + 'foaf': 'http://xmlns.com/foaf/0.1/', + 'hint': 'http://www.bigdata.com/queryHints#', + 'dc': 'http://purl.org/dc/elements/1.1/', + 'xsd': 'http://www.w3.org/2001/XMLSchema#' +}; + +$('.namespace-shortcuts').html('<ul>'); +for(var ns in NAMESPACE_SHORTCUTS) { + $('.namespace-shortcuts ul').append('<li data-ns="prefix ' + ns + ': <' + NAMESPACE_SHORTCUTS[ns] + '>">' + ns.toUpperCase() + '</li>'); +} + $('.namespace-shortcuts li').click(function() { var textarea = $(this).parents('.tab').find('textarea'); var current = textarea.val(); @@ -600,7 +617,7 @@ } else { var text = binding.value; if(binding.type == 'uri') { - text = '<' + text + '>'; + text = abbreviate(text); } } linkText = escapeHTML(text).replace(/\n/g, '<br>'); @@ -649,7 +666,8 @@ loadURI(uri); // if this is a SID, make the components clickable - var re = /<< *(<[^<>]*>) *(<[^<>]*>) *(<[^<>]*>) *>>/; + // var re = /<< *(<[^<>]*>) *(<[^<>]*>) *(<[^<>]*>) *>>/; + var re = /<< *([^ ]+) +([^ ]+) +([^ ]+) *>>/; var match = uri.match(re); if(match) { var header = $('<h1>'); @@ -672,7 +690,8 @@ function loadURI(target) { // identify if this is a vertex or a SID target = target.trim().replace(/\n/g, ' '); - var re = /<< *(?:<[^<>]*> *){3} *>>/; + // var re = /<< *(?:<[^<>]*> *){3} *>>/; + var re = /<< *([^ ]+) +([^ ]+) +([^ ]+) *>>/; var vertex = !target.match(re); var vertexQuery = '\ @@ -815,7 +834,7 @@ function explore(uri, nopush) { $('#explore-form input[type=text]').val(uri); $('#explore-form').submit(); - showTab('explore'); + showTab('explore', true); if(!nopush) { history.pushState(null, null, '#explore:' + NAMESPACE + ':' + uri); } @@ -970,11 +989,21 @@ /* Utility functions */ function getSID(binding) { - return '<<\n <' + binding.value['s'].value + '>\n<' + binding.value['p'].value + '>\n <' + binding.value['o'].value + '>\n>>'; + return '<<\n ' + abbreviate(binding.value['s'].value) + '\n ' + abbreviate(binding.value['p'].value) + '\n ' + abbreviate(binding.value['o'].value) + '\n>>'; } +function abbreviate(uri) { + for(var ns in NAMESPACE_SHORTCUTS) { + if(uri.indexOf(NAMESPACE_SHORTCUTS[ns]) == 0) { + return uri.replace(NAMESPACE_SHORTCUTS[ns], ns + ':'); + } + } + return '<' + uri + '>'; +} + function parseSID(sid) { - var re = /<< <([^<>]*)> <([^<>]*)> <([^<>]*)> >>/; + // var re = /<< <([^<>]*)> <([^<>]*)> <([^<>]*)> >>/; + var re = /<< *([^ ]+) +([^ ]+) +([^ ]+) *>>/; var matches = sid.match(re); return {'s': matches[1], 'p': matches[2], 'o': matches[3]}; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-08 20:09:18
|
Revision: 8086 http://sourceforge.net/p/bigdata/code/8086 Author: tobycraig Date: 2014-04-08 20:09:14 +0000 (Tue, 08 Apr 2014) Log Message: ----------- #875 - Fixed RDF/JSON export and added import capability Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-08 15:22:08 UTC (rev 8085) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-08 20:09:14 UTC (rev 8086) @@ -54,6 +54,7 @@ <option value="n-triples">N-Triples</option> <option value="n3">Notation3</option> <option value="rdf/xml">RDF/XML</option> + <option value="json">JSON</option> <option value="trig">TriG</option> <option value="trix">TriX</option> <option value="turtle">Turtle</option> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-08 15:22:08 UTC (rev 8085) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-08 20:09:14 UTC (rev 8086) @@ -1,5 +1,8 @@ $(function() { +// global variables +var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, NAMESPACE_SHORTCUTS, FILE_CONTENTS, QUERY_RESULTS; + /* Search */ $('#search-form').submit(function(e) { @@ -169,7 +172,6 @@ useNamespace(DEFAULT_NAMESPACE, url); }); } -var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, fileContents, NAMESPACE_SHORTCUTS; getDefaultNamespace(); @@ -245,7 +247,7 @@ $('#filename').html(f.name); $('#large-file-message, #clear-file').show() $('#load-box').val(''); - fileContents = e2.target.result; + FILE_CONTENTS = e2.target.result; } else { // display file contents in the textarea clearFile(); @@ -265,7 +267,7 @@ } $('#load-box').prop('disabled', false) $('#large-file-message, #clear-file').hide() - fileContents = null; + FILE_CONTENTS = null; } function guessType(extension, content) { @@ -338,6 +340,7 @@ 'rdfs': 'rdf/xml', 'owl': 'rdf/xml', 'xml': 'rdf/xml', + 'json': 'json', 'trig': 'trig', 'trix': 'trix', //'xml': 'trix', @@ -347,6 +350,7 @@ 'n-triples': 'text/plain', 'n3': 'text/n3', 'rdf/xml': 'application/rdf+xml', + 'json': 'application/sparql-results+json', 'trig': 'application/trig', 'trix': 'application/trix', 'turtle': 'text/turtle'}; @@ -368,7 +372,7 @@ var settings = { type: 'POST', - data: fileContents == null ? $('#load-box').val() : fileContents, + data: FILE_CONTENTS == null ? $('#load-box').val() : FILE_CONTENTS, success: updateResponseXML, error: updateResponseError } @@ -505,40 +509,7 @@ } function exportJSON() { - var json = {} - if($('#query-response table').hasClass('boolean')) { - json.head = {}; - json['boolean'] = $('#query-response td').text(); - } else { - json.head = {vars: []}; - $('#query-response thead tr td').each(function(i, td) { - json.head.vars.push(td.textContent); - }); - json.bindings = []; - $('#query-response tbody tr').each(function(i, tr) { - var binding = {}; - $(tr).find('td').each(function(j, td) { - var bindingFields = {} - var bindingType = td.className; - if(bindingType == 'unbound') { - return; - } - bindingFields.type = bindingType; - var dataType = $(td).data('datatype'); - if(dataType) { - bindingFields.type = dataType; - } - var lang = $(td).data('lang'); - if(lang) { - bindingFields.lang = lang; - } - bindingFields.value = td.textContent; - binding[json.head.vars[j]] = bindingFields; - }); - json.bindings.push(binding); - }); - } - json = JSON.stringify(json); + var json = JSON.stringify(QUERY_RESULTS); downloadFile(json, 'application/sparql-results+json', 'export.json'); } @@ -593,6 +564,8 @@ } } else { // JSON + // save data for export + QUERY_RESULTS = data; if(typeof(data.boolean) != 'undefined') { // ASK query table.append('<tr><td>' + data.boolean + '</td></tr>').addClass('boolean'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-08 22:24:42
|
Revision: 8089 http://sourceforge.net/p/bigdata/code/8089 Author: tobycraig Date: 2014-04-08 22:24:37 +0000 (Tue, 08 Apr 2014) Log Message: ----------- Changed type labels, RDF format selector always visible Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-08 22:22:47 UTC (rev 8088) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-08 22:24:37 UTC (rev 8089) @@ -145,10 +145,6 @@ box-sizing: border-box; } -#rdf-type-container { - display: none; -} - hr { background: #929292; border: none; Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-08 22:22:47 UTC (rev 8088) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-08 22:24:37 UTC (rev 8089) @@ -42,24 +42,22 @@ <input type="file" id="load-file"><br> <label for="load-type">Type:</label> <select id="load-type"> - <option value="sparql" selected="selected">SPARQL</option> - <option value="rdf">RDF</option> - <option value="path">File path</option> + <option value="sparql" selected="selected">SPARQL Update</option> + <option value="rdf">RDF Data</option> + <option value="path">File Path or URL</option> </select> - <span id="rdf-type-container"> - <label for="rdf-type">Format:</label> - <select id="rdf-type"> - <option value="">Select RDF format</option> - <option value="n-quads">N-Quads</option> - <option value="n-triples">N-Triples</option> - <option value="n3">Notation3</option> - <option value="rdf/xml">RDF/XML</option> - <option value="json">JSON</option> - <option value="trig">TriG</option> - <option value="trix">TriX</option> - <option value="turtle">Turtle</option> - </select> - </span> + <label for="rdf-type">Format:</label> + <select id="rdf-type"> + <option value="">Select RDF format</option> + <option value="n-quads">N-Quads</option> + <option value="n-triples">N-Triples</option> + <option value="n3">Notation3</option> + <option value="rdf/xml">RDF/XML</option> + <option value="json">JSON</option> + <option value="trig">TriG</option> + <option value="trix">TriX</option> + <option value="turtle">Turtle</option> + </select> </p> <hr class="shadow"> <button id="load-load">Load</button> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-08 22:22:47 UTC (rev 8088) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-08 22:24:37 UTC (rev 8089) @@ -317,17 +317,10 @@ } } -function handleTypeChange(e) { - $('#rdf-type-container').toggle($(this).val() == 'rdf'); -} - function setType(type, format) { $('#load-type').val(type); if(type == 'rdf') { - $('#rdf-type-container').show(); $('#rdf-type').val(format); - } else { - $('#rdf-type-container').hide(); } } @@ -362,7 +355,6 @@ .on('drop', handleFile) .on('paste', handlePaste) .bind('keydown', 'ctrl+return', submitLoad); -$('#load-type').change(handleTypeChange); $('#clear-file').click(clearFile); $('#load-load').click(submitLoad); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-10 21:37:43
|
Revision: 8100 http://sourceforge.net/p/bigdata/code/8100 Author: tobycraig Date: 2014-04-10 21:37:38 +0000 (Thu, 10 Apr 2014) Log Message: ----------- Initial go at RDF export Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-10 00:59:10 UTC (rev 8099) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-10 21:37:38 UTC (rev 8100) @@ -121,6 +121,38 @@ border-bottom: 1px solid; } +.modal { + display: none; + z-index: 1; + position: fixed; + top: 0; + left: 0; + width: 50%; + margin-top: 100px; + margin-left: 25%; + background-color: white; + padding: 20px; +} + +#overlay { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: grey; + opacity: 0.5; +} + +.modal-open #overlay { + display: initial; +} + +.modal-open { + overflow: hidden; +} + .namespace-shortcuts { text-align: right; } Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-10 00:59:10 UTC (rev 8099) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-10 21:37:38 UTC (rev 8100) @@ -107,6 +107,7 @@ </div> <div class="bottom"> + <button id="query-export-rdf">Export RDF</button> <button id="query-export-csv">Export CSV</button> <button id="query-export-json">Export JSON</button> <button id="query-export-xml">Export XML</button> @@ -115,6 +116,20 @@ </div> + <div id="query-export" class="modal"> + <select> + <option value="application/rdf+xml">RDF/XML</option> + <option value="application/x-turtle">N-Triples</option> + <option value="application/x-turtle">Turtle</option> + <option value="text/rdf+n3">N3</option> + <option value="application/trix">TriX</option> + <option value="application/x-trig">TRIG</option> + <option value="text/x-nquads">NQUADS</option> + </select> + <button id="query-download-rdf">Export</button> + <button class="modal-cancel">Cancel</button> + </div> + <div class="tab" id="explore-tab"> <div class="box"> @@ -172,6 +187,8 @@ </div> + <div id="overlay"></div> + <!--[if IE]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="/bigdata/html/js/vendor/jquery.min.js"><\/script>')</script> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-10 00:59:10 UTC (rev 8099) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-10 21:37:38 UTC (rev 8100) @@ -3,6 +3,18 @@ // global variables var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, NAMESPACE_SHORTCUTS, FILE_CONTENTS, QUERY_RESULTS; +/* Modal functions */ + +function showModal(id) { + $('#' + id).show(); + $('body').addClass('modal-open'); +} + +$('.modal-cancel').click(function() { + $('body').removeClass('modal-open'); + $(this).parents('.modal').hide(); +}); + /* Search */ $('#search-form').submit(function(e) { @@ -466,10 +478,34 @@ $('#query-response, #query-explanation, #query-tab .bottom *').hide(); }); +$('#query-export-rdf').click(function() { showModal('query-export'); }); $('#query-export-csv').click(exportCSV); $('#query-export-json').click(exportJSON); $('#query-export-xml').click(exportXML); +$('#query-download-rdf').click(function() { + var dataType = $(this).siblings('select').val(); + var settings = { + type: 'POST', + data: JSON.stringify(QUERY_RESULTS), + contentType: 'application/sparql-results+json', + headers: { 'Accept': dataType }, + success: downloadRDFSuccess, + error: downloadRDFError + }; + $.ajax('/bigdata/sparql?workbench&convert', settings); + $(this).siblings('.modal-cancel').click(); +}); + +function downloadRDFSuccess(data) { + console.log(data); + downloadFile(data, 'text/plain', 'export'); +} + +function downloadRDFError(jqXHR, textStatus, errorThrown) { + alert(errorThrown); +} + function exportXML() { var xml = '<?xml version="1.0"?>\n<sparql xmlns="http://www.w3.org/2005/sparql-results#">\n\t<head>\n'; var bindings = []; @@ -533,6 +569,7 @@ function showQueryResults(data) { $('#query-response').empty(); + $('#query-export-rdf').hide(); $('#query-response, #query-tab .bottom *').show(); var table = $('<table>').appendTo($('#query-response')); if(this.dataTypes[1] == 'xml') { @@ -611,6 +648,13 @@ table.append(tr); } + // see if we have RDF data + if(vars.length == 3) { + if(vars[0] == 's' && vars[1] == 'p' && vars[2] == 'o') { + $('#query-export-rdf').show(); + } + } + $('#query-response a').click(function(e) { e.preventDefault(); explore(this.textContent); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-11 18:53:21
|
Revision: 8109 http://sourceforge.net/p/bigdata/code/8109 Author: tobycraig Date: 2014-04-11 18:53:18 +0000 (Fri, 11 Apr 2014) Log Message: ----------- Removed RDF types from index.html, dynamically generating list instead, and fixed export filename extensions Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-11 18:18:38 UTC (rev 8108) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-11 18:53:18 UTC (rev 8109) @@ -118,13 +118,6 @@ <div id="query-export" class="modal"> <select> - <option value="application/rdf+xml">RDF/XML</option> - <option value="application/x-turtle">N-Triples</option> - <option value="application/x-turtle">Turtle</option> - <option value="text/rdf+n3">N3</option> - <option value="application/trix">TriX</option> - <option value="application/x-trig">TRIG</option> - <option value="text/x-nquads">NQUADS</option> </select> <button id="query-download-rdf">Export</button> <button class="modal-cancel">Cancel</button> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-11 18:18:38 UTC (rev 8108) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-11 18:53:18 UTC (rev 8109) @@ -483,6 +483,20 @@ $('#query-export-json').click(exportJSON); $('#query-export-xml').click(exportXML); +var rdf_extensions = { + "application/rdf+xml": ['RDF/XML', 'rdf'], + "application/x-turtle": ['N-Triples', 'nt'], + "application/x-turtle": ['Turtle', 'ttl'], + "text/rdf+n3": ['N3', 'n3'], + "application/trix": ['TriX', 'trix'], + "application/x-trig": ['TRIG', 'trig'], + "text/x-nquads": ['NQUADS', 'nq'] +}; + +for(var contentType in rdf_extensions) { + $('#query-export select').append('<option value="' + contentType + '">' + rdf_extensions[contentType][0] + '</option>'); +} + $('#query-download-rdf').click(function() { var dataType = $(this).siblings('select').val(); var settings = { @@ -490,16 +504,16 @@ data: JSON.stringify(QUERY_RESULTS), contentType: 'application/sparql-results+json', headers: { 'Accept': dataType }, - success: downloadRDFSuccess, + success: function(data) { downloadRDFSuccess(data, dataType); }, error: downloadRDFError }; $.ajax('/bigdata/sparql?workbench&convert', settings); $(this).siblings('.modal-cancel').click(); }); -function downloadRDFSuccess(data) { - console.log(data); - downloadFile(data, 'text/plain', 'export'); +function downloadRDFSuccess(data, dataType) { + var filename = 'export.' + rdf_extensions[dataType][1]; + downloadFile(data, dataType, filename); } function downloadRDFError(jqXHR, textStatus, errorThrown) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-11 21:16:53
|
Revision: 8111 http://sourceforge.net/p/bigdata/code/8111 Author: tobycraig Date: 2014-04-11 21:16:50 +0000 (Fri, 11 Apr 2014) Log Message: ----------- User can now choose a custom filename when exporting data Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-11 18:58:09 UTC (rev 8110) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-11 21:16:50 UTC (rev 8111) @@ -117,10 +117,20 @@ </div> <div id="query-export" class="modal"> - <select> - </select> - <button id="query-download-rdf">Export</button> - <button class="modal-cancel">Cancel</button> + <h1>Export</h1> + <p> + <label for="export-format">Format: </label> + <select id="export-format"></select> + </p> + <p> + <label for="export-filename">Filename: </label> + <input type="text" id="export-filename" value="export"> + .<span id="export-filename-extension"></span> + </p> + <p> + <button id="query-download-rdf">Export</button> + <button class="modal-cancel">Cancel</button> + </p> </div> <div class="tab" id="explore-tab"> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-11 18:58:09 UTC (rev 8110) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-11 21:16:50 UTC (rev 8111) @@ -478,7 +478,7 @@ $('#query-response, #query-explanation, #query-tab .bottom *').hide(); }); -$('#query-export-rdf').click(function() { showModal('query-export'); }); +$('#query-export-rdf').click(function() { updateExportFileExtension(); showModal('query-export'); }); $('#query-export-csv').click(exportCSV); $('#query-export-json').click(exportJSON); $('#query-export-xml').click(exportXML); @@ -494,25 +494,34 @@ }; for(var contentType in rdf_extensions) { - $('#query-export select').append('<option value="' + contentType + '">' + rdf_extensions[contentType][0] + '</option>'); + $('#export-format').append('<option value="' + contentType + '">' + rdf_extensions[contentType][0] + '</option>'); } +$('#export-format').change(updateExportFileExtension); + +function updateExportFileExtension() { + $('#export-filename-extension').html(rdf_extensions[$('#export-format').val()][1]); +} + $('#query-download-rdf').click(function() { - var dataType = $(this).siblings('select').val(); + var dataType = $('#export-format').val(); var settings = { type: 'POST', data: JSON.stringify(QUERY_RESULTS), contentType: 'application/sparql-results+json', headers: { 'Accept': dataType }, - success: function(data) { downloadRDFSuccess(data, dataType); }, + success: function(data) { downloadRDFSuccess(data, dataType, $('#export-filename').val()); }, error: downloadRDFError }; $.ajax('/bigdata/sparql?workbench&convert', settings); $(this).siblings('.modal-cancel').click(); }); -function downloadRDFSuccess(data, dataType) { - var filename = 'export.' + rdf_extensions[dataType][1]; +function downloadRDFSuccess(data, dataType, filename) { + if(filename == '') { + filename = 'export'; + } + filename += '.' + rdf_extensions[dataType][1]; downloadFile(data, dataType, filename); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-17 04:24:41
|
Revision: 8124 http://sourceforge.net/p/bigdata/code/8124 Author: tobycraig Date: 2014-04-17 04:24:36 +0000 (Thu, 17 Apr 2014) Log Message: ----------- Reduced export buttons to just one, with all RDF/non-RDF options in the dropdown Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-15 17:08:37 UTC (rev 8123) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-17 04:24:36 UTC (rev 8124) @@ -107,20 +107,20 @@ </div> <div class="bottom"> - <button id="query-export-rdf">Export RDF</button> - <button id="query-export-csv">Export CSV</button> - <button id="query-export-json">Export JSON</button> - <button id="query-export-xml">Export XML</button> + <button id="query-export">Export</button> <button id="query-response-clear">Clear</button> </div> </div> - <div id="query-export" class="modal"> + <div id="query-export-modal" class="modal"> <h1>Export</h1> <p> <label for="export-format">Format: </label> - <select id="export-format"></select> + <select id="export-format"> + <optgroup id="rdf-formats" label="RDF"></optgroup> + <optgroup id="non-rdf-formats" label="Other"></optgroup> + </select> </p> <p> <label for="export-filename">Filename: </label> @@ -128,7 +128,7 @@ .<span id="export-filename-extension"></span> </p> <p> - <button id="query-download-rdf">Export</button> + <button id="query-download">Export</button> <button class="modal-cancel">Cancel</button> </p> </div> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-15 17:08:37 UTC (rev 8123) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-17 04:24:36 UTC (rev 8124) @@ -478,58 +478,66 @@ $('#query-response, #query-explanation, #query-tab .bottom *').hide(); }); -$('#query-export-rdf').click(function() { updateExportFileExtension(); showModal('query-export'); }); -$('#query-export-csv').click(exportCSV); -$('#query-export-json').click(exportJSON); -$('#query-export-xml').click(exportXML); +$('#query-export').click(function() { updateExportFileExtension(); showModal('query-export-modal'); }); -var rdf_extensions = { - "application/rdf+xml": ['RDF/XML', 'rdf'], - "application/x-turtle": ['N-Triples', 'nt'], - "application/x-turtle": ['Turtle', 'ttl'], - "text/rdf+n3": ['N3', 'n3'], - "application/trix": ['TriX', 'trix'], - "application/x-trig": ['TRIG', 'trig'], - "text/x-nquads": ['NQUADS', 'nq'] +var export_extensions = { + "application/rdf+xml": ['RDF/XML', 'rdf', true], + "application/x-turtle": ['N-Triples', 'nt', true], + "application/x-turtle": ['Turtle', 'ttl', true], + "text/rdf+n3": ['N3', 'n3', true], + "application/trix": ['TriX', 'trix', true], + "application/x-trig": ['TRIG', 'trig', true], + "text/x-nquads": ['NQUADS', 'nq', true], + + "text/csv": ['CSV', 'csv', false, exportCSV], + "application/sparql-results+json": ['JSON', 'json', false, exportJSON], + // "text/tab-separated-values": ['TSV', 'tsv', false, exportTSV], + "application/sparql-results+xml": ['XML', 'xml', false, exportXML] }; -for(var contentType in rdf_extensions) { - $('#export-format').append('<option value="' + contentType + '">' + rdf_extensions[contentType][0] + '</option>'); +for(var contentType in export_extensions) { + var optgroup = export_extensions[contentType][2] ? '#rdf-formats' : '#non-rdf-formats'; + $(optgroup).append('<option value="' + contentType + '">' + export_extensions[contentType][0] + '</option>'); } +$('#export-format option:first').prop('selected', true); + $('#export-format').change(updateExportFileExtension); function updateExportFileExtension() { - $('#export-filename-extension').html(rdf_extensions[$('#export-format').val()][1]); + $('#export-filename-extension').html(export_extensions[$('#export-format').val()][1]); } -$('#query-download-rdf').click(function() { +$('#query-download').click(function() { var dataType = $('#export-format').val(); - var settings = { - type: 'POST', - data: JSON.stringify(QUERY_RESULTS), - contentType: 'application/sparql-results+json', - headers: { 'Accept': dataType }, - success: function(data) { downloadRDFSuccess(data, dataType, $('#export-filename').val()); }, - error: downloadRDFError - }; - $.ajax('/bigdata/sparql?workbench&convert', settings); - $(this).siblings('.modal-cancel').click(); -}); - -function downloadRDFSuccess(data, dataType, filename) { + var filename = $('#export-filename').val(); if(filename == '') { filename = 'export'; } - filename += '.' + rdf_extensions[dataType][1]; - downloadFile(data, dataType, filename); -} + filename += '.' + export_extensions[dataType][1]; + if(export_extensions[dataType][2]) { + // RDF + var settings = { + type: 'POST', + data: JSON.stringify(QUERY_RESULTS), + contentType: 'application/sparql-results+json', + headers: { 'Accept': dataType }, + success: function() { downloadFile(data, dataType, filename); }, + error: downloadRDFError + }; + $.ajax('/bigdata/sparql?workbench&convert', settings); + } else { + // not RDF + export_extensions[dataType][3](filename); + } + $(this).siblings('.modal-cancel').click(); +}); function downloadRDFError(jqXHR, textStatus, errorThrown) { alert(errorThrown); } -function exportXML() { +function exportXML(filename) { var xml = '<?xml version="1.0"?>\n<sparql xmlns="http://www.w3.org/2005/sparql-results#">\n\t<head>\n'; var bindings = []; $('#query-response thead tr td').each(function(i, td) { @@ -561,27 +569,32 @@ xml += '\t\t</result>\n'; }); xml += '\t</results>\n</sparql>\n'; - downloadFile(xml, 'application/sparql-results+xml', 'export.xml'); + downloadFile(xml, 'application/sparql-results+xml', filename); } -function exportJSON() { +function exportJSON(filename) { var json = JSON.stringify(QUERY_RESULTS); - downloadFile(json, 'application/sparql-results+json', 'export.json'); + downloadFile(json, 'application/sparql-results+json', filename); } -function exportCSV() { - // FIXME: escape commas +function exportCSV(filename) { var csv = ''; $('#query-response table tr').each(function(i, tr) { $(tr).find('td').each(function(j, td) { if(j > 0) { csv += ','; } - csv += td.textContent; + var val = td.textContent; + // quote value if it contains " , \n or \r + // replace " with "" + if(val.match(/[",\n\r]/)) { + val = '"' + val.replace('"', '""') + '"'; + } + csv += val; }); csv += '\n'; }); - downloadFile(csv, 'application/csv', 'export.csv'); + downloadFile(csv, 'text/csv', filename); } function downloadFile(data, type, filename) { @@ -680,9 +693,12 @@ // remove (unused) c variable from JSON QUERY_RESULTS.head.vars.pop() } - $('#query-export-rdf').show(); + $('#rdf-formats').prop('disabled', false); } else { - $('#query-export-rdf').hide(); + $('#rdf-formats').prop('disabled', true); + if($('#rdf-formats option:selected').length == 1) { + $('#non-rdf-formats option:first').prop('selected', true); + } } $('#query-response a').click(function(e) { @@ -1048,6 +1064,16 @@ return '<' + uri + '>'; } +function unabbreviate(uri) { + if(uri.charAt(0) == '<') { + // not abbreviated + return uri; + } + // get namespace + var namespace = uri.split(':', 1)[0]; + return '<' + uri.replace(namespace, NAMESPACE_SHORTCUTS[namespace]) + '>'; +} + function parseSID(sid) { // var re = /<< <([^<>]*)> <([^<>]*)> <([^<>]*)> >>/; var re = /<< *([^ ]+) +([^ ]+) +([^ ]+) *>>/; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-21 16:35:39
|
Revision: 8131 http://sourceforge.net/p/bigdata/code/8131 Author: tobycraig Date: 2014-04-21 16:35:35 +0000 (Mon, 21 Apr 2014) Log Message: ----------- Added pagination to query results (forgotten files) Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-21 14:33:56 UTC (rev 8130) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-21 16:35:35 UTC (rev 8131) @@ -207,19 +207,27 @@ border: none; } -#advanced-features, #query-response, #query-explanation, #query-tab .bottom *, #load-response, #load-clear, #explore-results, #namespace-properties { +#advanced-features, #query-response, #query-pagination, #query-explanation, #query-tab .bottom *, #load-response, #load-clear, #explore-results, #namespace-properties { display: none; } -td { +th, td { border: 1px solid; padding: 5px; } +th { + font-weight: bold; +} + pre { font-family: monospace; } +#page-selector { + float: right; +} + #running-queries li { margin: 10px 0; } Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-21 14:33:56 UTC (rev 8130) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-21 16:35:35 UTC (rev 8131) @@ -103,6 +103,21 @@ <div id="query-response" class="box"> </div> + <div id="query-pagination" class="box"> + <span id="current-results"></span> + <select id="results-per-page"> + <option>10</option> + <option>25</option> + <option>50</option> + <option>100</option> + </select> per page + <div id="page-selector"> + <button id="previous-page"><</button> + Page <input type="text" id="current-page"> of <span id="result-pages"></span> + <button id="next-page">></button> + </div> + </div> + <div id="query-explanation" class="box"> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-21 22:08:05
|
Revision: 8135 http://sourceforge.net/p/bigdata/code/8135 Author: tobycraig Date: 2014-04-21 22:08:01 +0000 (Mon, 21 Apr 2014) Log Message: ----------- Rudimentary error position highlighting in query, needs some polishing Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-21 21:04:52 UTC (rev 8134) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-21 22:08:01 UTC (rev 8135) @@ -228,6 +228,35 @@ float: right; } +#query-box { + background-color: transparent; + padding: 2px; + border-width: 1px; +} + +/* these should have the same typography so the error highlighting matches up with the query text */ +#query-box, #query-errors { + font-family: sans-serif; + font-size: 90%; + line-height: normal; +} + +#query-errors { + position: absolute; + z-index: -1; + padding: 8px 3px; + color: transparent; + white-space: pre; +} + +#error-line { + background-color: lightgreen; +} + +#error-character { + background-color: red; +} + #running-queries li { margin: 10px 0; } Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-21 21:04:52 UTC (rev 8134) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-21 22:08:01 UTC (rev 8135) @@ -80,6 +80,7 @@ </div> <form id="query-form"> + <div id="query-errors"></div> <textarea id="query-box" name="query" placeholder="(Input a SPARQL query)"></textarea> <a href="#" id="advanced-features-toggle">Advanced features</a> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-21 21:04:52 UTC (rev 8134) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-21 22:08:01 UTC (rev 8135) @@ -441,7 +441,8 @@ /* Query */ -$('#query-box').bind('keydown', 'ctrl+return', function(e) { e.preventDefault(); $('#query-form').submit(); }); +$('#query-box').bind('keydown', 'ctrl+return', function(e) { e.preventDefault(); $('#query-form').submit(); }) + .on('input propertychange', function() { $('#query-errors').hide(); }); $('#query-form').submit(submitQuery); function submitQuery(e) { @@ -699,6 +700,25 @@ function queryResultsError(jqXHR, textStatus, errorThrown) { $('#query-response, #query-tab .bottom *').show(); $('#query-response').text('Error! ' + textStatus + ' ' + jqXHR.statusText); + var match = errorThrown.match(/line (\d+), column (\d+)/); + if(match) { + // highlight character at error position + var line = match[1] - 1; + var column = match[2] - 1; + var query = $('#query-box').val(); + var lines = query.split('\n'); + $('#query-errors').html(''); + for(var i=0; i<line; i++) { + var p = $('<p>').text(lines[i]); + $('#query-errors').append(p); + } + $('#query-errors').append('<p id="error-line">'); + $('#error-line').append(document.createTextNode(lines[line].substr(0, column))); + $('#error-line').append($('<span id="error-character">').text(lines[line].charAt(column) || ' ')); + $('#error-line').append(document.createTextNode(lines[line].substr(column + 1))); + $('#query-errors').show(); + $('#query-box').scrollTop(0); + } } /* Pagination */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-21 23:19:02
|
Revision: 8136 http://sourceforge.net/p/bigdata/code/8136 Author: tobycraig Date: 2014-04-21 23:18:59 +0000 (Mon, 21 Apr 2014) Log Message: ----------- Added error highlighting for SPARQL update in load pane Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-21 22:08:01 UTC (rev 8135) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-21 23:18:59 UTC (rev 8136) @@ -228,20 +228,20 @@ float: right; } -#query-box { +#load-box, #query-box { background-color: transparent; padding: 2px; border-width: 1px; } /* these should have the same typography so the error highlighting matches up with the query text */ -#query-box, #query-errors { +#load-box, #load-errors, #query-box, #query-errors { font-family: sans-serif; font-size: 90%; line-height: normal; } -#query-errors { +#load-errors, #query-errors { position: absolute; z-index: -1; padding: 8px 3px; @@ -249,11 +249,11 @@ white-space: pre; } -#error-line { +.error-line { background-color: lightgreen; } -#error-character { +.error-character { background-color: red; } Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-21 22:08:01 UTC (rev 8135) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-21 23:18:59 UTC (rev 8136) @@ -36,7 +36,10 @@ <div class="namespace-shortcuts"> </div> - <textarea id="load-box" placeholder="(Type in or drag a file containing RDF data, a SPARQL update or a file path or URL)"></textarea> + <div> + <div id="load-errors"></div> + <textarea id="load-box" placeholder="(Type in or drag a file containing RDF data, a SPARQL update or a file path or URL)"></textarea> + </div> <p id="large-file-message">Your file <span id="filename"></span> is too large to display here, but will be uploaded as normal. <a href="#" id="clear-file">Remove file</a></p> <p> <input type="file" id="load-file"><br> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-21 22:08:01 UTC (rev 8135) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-21 23:18:59 UTC (rev 8136) @@ -367,6 +367,7 @@ $('#load-box').on('dragover', handleDragOver) .on('drop', handleFile) .on('paste', handlePaste) + .on('input propertychange', function() { $('#load-errors').hide(); }) .bind('keydown', 'ctrl+return', submitLoad); $('#clear-file').click(clearFile); @@ -436,6 +437,7 @@ function updateResponseError(jqXHR, textStatus, errorThrown) { $('#load-response, #load-clear').show(); $('#load-response pre').text('Error! ' + textStatus + ' ' + jqXHR.statusText); + highlightError(jqXHR.statusText, 'load'); } @@ -700,24 +702,29 @@ function queryResultsError(jqXHR, textStatus, errorThrown) { $('#query-response, #query-tab .bottom *').show(); $('#query-response').text('Error! ' + textStatus + ' ' + jqXHR.statusText); - var match = errorThrown.match(/line (\d+), column (\d+)/); + highlightError(jqXHR.statusText, 'query'); +} + +function highlightError(description, pane) { + var match = description.match(/line (\d+), column (\d+)/); if(match) { // highlight character at error position var line = match[1] - 1; var column = match[2] - 1; - var query = $('#query-box').val(); - var lines = query.split('\n'); - $('#query-errors').html(''); + var input = $('#' + pane + '-box').val(); + var lines = input.split('\n'); + var container = '#' + pane + '-errors'; + $(container).html(''); for(var i=0; i<line; i++) { var p = $('<p>').text(lines[i]); - $('#query-errors').append(p); + $(container).append(p); } - $('#query-errors').append('<p id="error-line">'); - $('#error-line').append(document.createTextNode(lines[line].substr(0, column))); - $('#error-line').append($('<span id="error-character">').text(lines[line].charAt(column) || ' ')); - $('#error-line').append(document.createTextNode(lines[line].substr(column + 1))); - $('#query-errors').show(); - $('#query-box').scrollTop(0); + $(container).append('<p class="error-line">'); + $(container + ' .error-line').append(document.createTextNode(lines[line].substr(0, column))); + $(container + ' .error-line').append($('<span class="error-character">').text(lines[line].charAt(column) || ' ')); + $(container + ' .error-line').append(document.createTextNode(lines[line].substr(column + 1))); + $(container).show(); + $('#' + pane + '-box').scrollTop(0); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-26 00:55:30
|
Revision: 8139 http://sourceforge.net/p/bigdata/code/8139 Author: tobycraig Date: 2014-04-26 00:55:27 +0000 (Sat, 26 Apr 2014) Log Message: ----------- New workbench styling (still in progress) Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-24 10:02:02 UTC (rev 8138) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-26 00:55:27 UTC (rev 8139) @@ -51,7 +51,11 @@ /* Workbench */ body { - margin: 10px; + margin: 50px 10px; + background-color: #f1f1f1; + font-family: sans-serif; + font-size: 80%; + color: #545454; } h1 { @@ -65,7 +69,8 @@ } #container { - /*max-width: 600px;*/ + max-width: 1000px; + margin: 0 auto; } #top { @@ -77,6 +82,33 @@ float: left; } +#search-form { + padding-top: 80px; +} + +#search-form label { + font-size: 50%; +} + +#search-form input { + border: 1px solid #e3e3e3; + margin: 0; + height: 21px; +} + +#search-form button { + background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAMCAMAAACDd7esAAAArlBMVEX////7+/vQ0NDExMT09PSzs7MZGRkAAAAHBweHh4f9/f3JyckDAwNXV1fPz8/b29uCgoIEBASNjY1GRkY8PDz+/v57e3sLCwsRERGOjo7Nzc3R0dEjIyO7u7vf399ra2sVFRXk5OT4+PhAQEAqKirw8PAkJCQSEhJvb28pKSlpaWn5+fny8vJ0dHQwMDAhISFYWFgYGBg+Pj7t7e0lJSXZ2dmlpaUmJiahoaGMjIzmLhVjAAAACXZwQWcAAAAVAAAAFABoZ/l0AAAAXklEQVQIHQXBAwLDQAAAsHS6sXNn29b/P7YEUSqdAWRzIeQLRSiVK3G1Vm9As9VG0onQ7UE/DDBMYBTGmExnzBdLWK0322QX9gc4ns6Xa3y7PwCk888XgHf4APD9/QGT1gbfV95+QQAAAABJRU5ErkJggg=='); + background-repeat: no-repeat; + background-color: white; + background-position: 6px 6px; + border: 1px solid #e3e3e3; + border-left: none; + padding: 0; + margin: 0; + width: 25px; + height: 25px; +} + .shadow { -webkit-box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); -moz-box-shadow: 0px 3px 5px 0px rgba(50, 50, 50, 0.75); @@ -85,40 +117,50 @@ #tab-selector { clear: both; + padding-top: 20px; } #tab-selector a { padding: 10px; - border: 1px solid; - border-right: none; + border: 1px solid #dadada; border-bottom: none; display: inline-block; float: left; cursor: pointer; + width: 108px; + margin-right: 9px; + text-transform: uppercase; + text-align: center; + font-weight: bold; + background-color: #ebebeb; } -#tab-selector a:last-of-type { - border-right: 1px solid; +#tab-selector p { + float: right; + font-weight: bold; + padding-top: 11px; } -.active { - background: lightgrey; +#tab-selector .active { + background: white; + border-color: white; } .tab { display: none; clear: both; + background: white; } .box { - padding: 10px; - border: 1px solid; + padding: 20px 55px; + /*border: 1px solid;*/ border-bottom: none; overflow-x: scroll; } .box:last-of-type { - border-bottom: 1px solid; + /*border-bottom: 1px solid;*/ } .modal { @@ -154,17 +196,26 @@ } .namespace-shortcuts { - text-align: right; + float: right; + margin-bottom: 20px; } .namespace-shortcuts li { display: inline-block; - border: 1px solid; + border: 1px solid #e4e4e4; padding: 5px; margin-left: 5px; cursor: pointer; + width: 40px; + text-align: center; } +.namespace-shortcuts li:hover { + border-color: #b7b7b7; + background-color: #b7b7b7; + color: #ededed; +} + #large-file-message { display: none; margin: 5px 0; @@ -190,12 +241,8 @@ display: block; } -#load-buttons { - text-align: center; -} - .bottom { - border-top: 1px solid; + /*border-top: 1px solid;*/ text-align: right; } @@ -232,6 +279,7 @@ background-color: transparent; padding: 2px; border-width: 1px; + border-color: #e1e1e1; } /* these should have the same typography so the error highlighting matches up with the query text */ @@ -257,6 +305,14 @@ background-color: red; } +#advanced-features { + margin-right: 50px; +} + +#advanced-features label { + margin-left: 20px; +} + #running-queries li { margin: 10px 0; } @@ -277,3 +333,92 @@ overflow-x: scroll; } +.controls-container { + padding: 25px; +} + +button, input[type=reset], input[type=submit], input[type=file], select { + width: 110px; + height: 25px; + border: 1px solid #e4e4e4; + color: #616161; +} + +input[type=checkbox] { + display: none; +} + +input[type="checkbox"] + label span { + display: inline-block; + width: 13px; + height: 13px; + margin: 0; + vertical-align: middle; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAIAAAD9iXMrAAAA4UlEQVQoU11RARLCIAzr/1+hMHF7iN6x0rLph0wp9Tx3jLVrSNNALE24YR/PzlwRV9nftTPz42gnt2dj0iaXg5LSTagobWpxOqk02vr8CSiBANGqljsaaznIf95HClZCszLy3GnpVi7B7VCwQgBBShqg62uWs07QXI2g1bB+LgdZjtg0dNOKnvbm0beEmgkNARANB4wv95n/ifMYDmBWgnlewL4Gq6cYyw/DVxIRT5YfVh/rq9L0fflKWAg+H8sDw6kYzu/DTUbZJ0hxGFVgDIuPLeHOirHQBTt8HUHFxWLeD+xTIgvbAhziAAAAAElFTkSuQmCC"); +} + +input[type="checkbox"]:checked + label span { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAIAAAD9iXMrAAABb0lEQVQoFQXBTYuNYRjA8f913S/neRyUD2AzRVgoNTsZzUodG76Jz2QpZWEhNmNBaM682KCMEsnCHKYx5nm77+vy+8mbnf1spaZK0ShopQY1XI0qroTkdqoas5VnB+tNwyxikQgFJKAFM8rEauTe2nYE5g1NAy0xIpAdQMCNbuCCEUTVBWugJTf8+ND+/UWc0R/y7VOriWZGO8PdFTQFzgSSIKHbe3S/H3j9ZCGx04gqrrig4qYFALh0Az1/uv3wTpqXy9cJDo5Fqpi6MCZGqII7a5vP//yeX7n1ApgCABBcVZw8IU4A4Oe72+L6dWczCGogaCG4KioiuFDh83tWh+cWDx4frc5+2Q0i4AyRGlzNrFSqcXLMx6271za2YsvVm0/3Xy2Oj6hOHMCqLJfLl9/X85w8oxGqUB0VELynM+oJGxeXMTljhxrSUxM1oAURCmBMI/8GFJW3u3vRJhcVN4jJy6iqSKHmkk1LttDH+h9YiLIwVyNFQAAAAABJRU5ErkJggg=="); +} + + +.clear { + clear: both; +} + +.right { + float: right; +} + +.orange { + background-color: #ffd8b3; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#ffd8b3)); + background-image: -webkit-linear-gradient(top, #ffffff, #ffd8b3); + background-image: -moz-linear-gradient(top, #ffffff, #ffd8b3); + background-image: -ms-linear-gradient(top, #ffffff, #ffd8b3); + background-image: -o-linear-gradient(top, #ffffff, #ffd8b3); + background-image: linear-gradient(to bottom, #ffffff, #ffd8b3); + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffffff, endColorstr=#ffd8b3); +} + +.blue { + background-color: #d3e4f6; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#d3e4f6)); + background-image: -webkit-linear-gradient(top, #ffffff, #d3e4f6); + background-image: -moz-linear-gradient(top, #ffffff, #d3e4f6); + background-image: -ms-linear-gradient(top, #ffffff, #d3e4f6); + background-image: -o-linear-gradient(top, #ffffff, #d3e4f6); + background-image: linear-gradient(to bottom, #ffffff, #d3e4f6); + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffffff, endColorstr=#d3e4f6); +} + +.green { + background-color: #d9e689; + background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#d9e689)); + background-image: -webkit-linear-gradient(top, #ffffff, #d9e689); + background-image: -moz-linear-gradient(top, #ffffff, #d9e689); + background-image: -ms-linear-gradient(top, #ffffff, #d9e689); + background-image: -o-linear-gradient(top, #ffffff, #d9e689); + background-image: linear-gradient(to bottom, #ffffff, #d9e689); + filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffffff, endColorstr=#d9e689); +} + +#query-pagination { + border: 1px solid #e1e1e1; + padding: 10px 25px; + margin: 0 55px; +} + +#results-per-page { + width: 60px; +} + +#query-pagination button { + width: 20px; + height: 20px; + border: 1px solid #e1e1e1; + background: transparent; +} + +#current-page { + border: 1px solid #e1e1e1; \ No newline at end of file Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-24 10:02:02 UTC (rev 8138) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-26 00:55:27 UTC (rev 8139) @@ -16,8 +16,7 @@ <div id="top"> <img src="/bigdata/html/images/logo.png" id="logo"> - <form id="search-form"><label for="search-text">Search:</label> <input type="text" id="search-text"></form> - <p>Current namespace: <span id="current-namespace"></span></p> + <form id="search-form"><label for="search-text">SEARCH:</label> <input type="text" id="search-text"><button type="submit"><span> </span></button></form> </div> <div id="tab-selector"> @@ -27,6 +26,7 @@ <a data-target="status">Status</a> <a data-target="performance">Performance</a> <a data-target="namespaces">Namespaces</a> + <p>Current namespace: <span id="current-namespace"></span></p> </div> <div class="tab" id="load-tab"> @@ -51,7 +51,6 @@ </select> <label for="rdf-type">Format:</label> <select id="rdf-type"> - <option value="">Select RDF format</option> <option value="n-quads">N-Quads</option> <option value="n-triples">N-Triples</option> <option value="n3">Notation3</option> @@ -86,20 +85,21 @@ <div id="query-errors"></div> <textarea id="query-box" name="query" placeholder="(Input a SPARQL query)"></textarea> - <a href="#" id="advanced-features-toggle">Advanced features</a> - - <div id="advanced-features"> - <input type="checkbox" id="query-explain"> <label for="query-explain">Explain</label> - <input type="checkbox" name="analytic" value="true" id="query-analytic"> <label for="query-analytic">Analytic</label> - <input type="checkbox" name="RTO" value="true" id="query-rto"> <label for="query-rto">Runtime Query Optimizer</label> + <div class="controls-container"> + <input type="reset" value="Clear" class="orange right"> </div> + <div class="controls-container"> + <div class="clear right"> + <a href="#" id="advanced-features-toggle">ADVANCED FEATURES</a>: + <span id="advanced-features"> + <input type="checkbox" id="query-explain"><label for="query-explain"><span></span> EXPLAIN</label> + <input type="checkbox" name="analytic" value="true" id="query-analytic"><label for="query-analytic"><span></span> ANALYTIC</label> + <input type="checkbox" name="RTO" value="true" id="query-rto"><label for="query-rto"><span></span> RUNTIME QUERY OPTIMIZER</label> + </span> + <input type="submit" value="Execute" class="green"> + </div> + </div> - <hr class="shadow"> - - <div id="load-buttons"> - <input type="submit" value="Execute"> - <input type="reset" value="Clear"> - </div> </form> </div> @@ -116,18 +116,18 @@ <option>100</option> </select> per page <div id="page-selector"> - <button id="previous-page"><</button> + <button id="previous-page">◀</button> Page <input type="text" id="current-page"> of <span id="result-pages"></span> - <button id="next-page">></button> + <button id="next-page">▶</button> </div> </div> <div id="query-explanation" class="box"> </div> - <div class="bottom"> - <button id="query-export">Export</button> - <button id="query-response-clear">Clear</button> + <div id="query-export-container" class="controls-container"> + <button id="query-export" class="right orange">Export</button> + <button id="query-response-clear" class="right clear orange">Clear</button> </div> </div> @@ -207,6 +207,8 @@ </div> + <div class="clear"> </div> + </div> <div id="overlay"></div> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-24 10:02:02 UTC (rev 8138) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-26 00:55:27 UTC (rev 8139) @@ -26,6 +26,7 @@ } var query = 'select ?s ?p ?o { ?o bds:search "' + term + '" . ?s ?p ?o . }' $('#query-box').val(query); + $('#query-errors').hide(); $('#query-form').submit(); showTab('query'); }); @@ -480,7 +481,7 @@ $('#query-response-clear').click(function() { $('#query-response, #query-explanation').empty(''); - $('#query-response, #query-pagination, #query-explanation, #query-tab .bottom *').hide(); + $('#query-response, #query-pagination, #query-explanation, #query-export-container').hide(); }); $('#query-export').click(function() { updateExportFileExtension(); showModal('query-export-modal'); }); @@ -611,7 +612,7 @@ function showQueryResults(data) { $('#query-response').empty(); $('#query-export-rdf').hide(); - $('#query-response, #query-pagination, #query-tab .bottom *').show(); + $('#query-response, #query-pagination, #query-export-container').show(); var table = $('<table>').appendTo($('#query-response')); if(this.dataTypes[1] == 'xml') { // RDF @@ -700,7 +701,7 @@ } function queryResultsError(jqXHR, textStatus, errorThrown) { - $('#query-response, #query-tab .bottom *').show(); + $('#query-response, #query-export-container').show(); $('#query-response').text('Error! ' + textStatus + ' ' + jqXHR.statusText); highlightError(jqXHR.statusText, 'query'); } @@ -812,7 +813,7 @@ } // update current results numbers - $('#current-results').html((start + 1) + ' - ' + end); + $('#current-results').html((start + 1) + '-' + end); $('#current-page').val(n); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-29 02:10:11
|
Revision: 8140 http://sourceforge.net/p/bigdata/code/8140 Author: tobycraig Date: 2014-04-29 02:10:07 +0000 (Tue, 29 Apr 2014) Log Message: ----------- Further workbench styling Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/index.html Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-26 00:55:27 UTC (rev 8139) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-29 02:10:07 UTC (rev 8140) @@ -154,13 +154,11 @@ .box { padding: 20px 55px; - /*border: 1px solid;*/ border-bottom: none; overflow-x: scroll; } .box:last-of-type { - /*border-bottom: 1px solid;*/ } .modal { @@ -228,21 +226,24 @@ box-sizing: border-box; } -hr { - background: #929292; - border: none; - height: 5px; - width: 50%; - margin: 20px auto; +label[for=load-type], label[for=rdf-type] { + margin: 0 10px 0 30px; } -#load-load { - margin: 0 auto; - display: block; +.has-vertical-divider { + line-height: 55px; } +.vertical-divider { + height: 55px; + display: inline-block; + width: 0; + border-left: 1px solid #d7d7d7; + padding-left: 30px; + margin-left: 30px; +} + .bottom { - /*border-top: 1px solid;*/ text-align: right; } @@ -254,7 +255,7 @@ border: none; } -#advanced-features, #query-response, #query-pagination, #query-explanation, #query-tab .bottom *, #load-response, #load-clear, #explore-results, #namespace-properties { +#advanced-features, #query-response, #query-pagination, #query-explanation, #query-export-container, #load-response, #load-clear, #explore-results, #namespace-properties { display: none; } @@ -337,13 +338,27 @@ padding: 25px; } -button, input[type=reset], input[type=submit], input[type=file], select { +button, input[type=reset], input[type=submit], input[type=file], #load-file-container, select { width: 110px; height: 25px; border: 1px solid #e4e4e4; color: #616161; } +#load-file-container { + display: inline-block; + position: relative; + text-align: center; + line-height: 25px; +} + +#load-file { + position: absolute; + top: 0; + left: 0; + opacity: 0; +} + input[type=checkbox] { display: none; } @@ -361,6 +376,9 @@ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAIAAAD9iXMrAAABb0lEQVQoFQXBTYuNYRjA8f913S/neRyUD2AzRVgoNTsZzUodG76Jz2QpZWEhNmNBaM682KCMEsnCHKYx5nm77+vy+8mbnf1spaZK0ShopQY1XI0qroTkdqoas5VnB+tNwyxikQgFJKAFM8rEauTe2nYE5g1NAy0xIpAdQMCNbuCCEUTVBWugJTf8+ND+/UWc0R/y7VOriWZGO8PdFTQFzgSSIKHbe3S/H3j9ZCGx04gqrrig4qYFALh0Az1/uv3wTpqXy9cJDo5Fqpi6MCZGqII7a5vP//yeX7n1ApgCABBcVZw8IU4A4Oe72+L6dWczCGogaCG4KioiuFDh83tWh+cWDx4frc5+2Q0i4AyRGlzNrFSqcXLMx6271za2YsvVm0/3Xy2Oj6hOHMCqLJfLl9/X85w8oxGqUB0VELynM+oJGxeXMTljhxrSUxM1oAURCmBMI/8GFJW3u3vRJhcVN4jJy6iqSKHmkk1LttDH+h9YiLIwVyNFQAAAAABJRU5ErkJggg=="); } +#load-response > pre { + overflow-x: scroll; +} .clear { clear: both; @@ -407,10 +425,12 @@ border: 1px solid #e1e1e1; padding: 10px 25px; margin: 0 55px; + color: #e1e1e1; } #results-per-page { width: 60px; + color: #e1e1e1; } #query-pagination button { @@ -418,7 +438,10 @@ height: 20px; border: 1px solid #e1e1e1; background: transparent; + color: #e1e1e1; } #current-page { - border: 1px solid #e1e1e1; \ No newline at end of file + border: 1px solid #e1e1e1; + color: #e1e1e1; +} Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-26 00:55:27 UTC (rev 8139) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-29 02:10:07 UTC (rev 8140) @@ -40,17 +40,22 @@ <div id="load-errors"></div> <textarea id="load-box" placeholder="(Type in or drag a file containing RDF data, a SPARQL update or a file path or URL)"></textarea> </div> - <p id="large-file-message">Your file <span id="filename"></span> is too large to display here, but will be uploaded as normal. <a href="#" id="clear-file">Remove file</a></p> - <p> - <input type="file" id="load-file"><br> - <label for="load-type">Type:</label> - <select id="load-type"> + + <div class="controls-container"> + <span id="load-file-container" class="orange">Upload a local file<input type="file" id="load-file"></span> + <button class="orange right">Clear</button> + <p id="large-file-message">Your file <span id="filename"></span> is too large to display here, but will be uploaded as normal. <a href="#" id="clear-file">Remove file</a></p> + </div> + + <div class="controls-container right has-vertical-divider"> + <label for="load-type">TYPE:</label> + <select id="load-type" class="blue"> <option value="sparql" selected="selected">SPARQL Update</option> <option value="rdf">RDF Data</option> <option value="path">File Path or URL</option> </select> - <label for="rdf-type">Format:</label> - <select id="rdf-type"> + <label for="rdf-type">FORMAT:</label> + <select id="rdf-type" class="blue"> <option value="n-quads">N-Quads</option> <option value="n-triples">N-Triples</option> <option value="n3">Notation3</option> @@ -60,19 +65,19 @@ <option value="trix">TriX</option> <option value="turtle">Turtle</option> </select> - </p> - <hr class="shadow"> - <button id="load-load">Load</button> + <span class="vertical-divider"> </span> + <button id="load-load" class="green">Load</button> + </div> + </div> <div class="box" id="load-response"> <pre></pre> + <div class="controls-container right"> + <button id="load-clear" class="orange">Clear output</button> + </div> </div> - <div class="bottom"> - <button id="load-clear">Clear output</button> - </div> - </div> <div class="tab" id="query-tab"> @@ -125,9 +130,11 @@ <div id="query-explanation" class="box"> </div> - <div id="query-export-container" class="controls-container"> - <button id="query-export" class="right orange">Export</button> - <button id="query-response-clear" class="right clear orange">Clear</button> + <div id="query-export-container" class="box"> + <div class="controls-container"> + <button id="query-export" class="right orange">Export</button> + <button id="query-response-clear" class="right clear orange">Clear</button> + </div> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-29 23:20:06
|
Revision: 8144 http://sourceforge.net/p/bigdata/code/8144 Author: tobycraig Date: 2014-04-29 23:20:01 +0000 (Tue, 29 Apr 2014) Log Message: ----------- Changed workbench styling Modified Paths: -------------- branches/RDR/bigdata-war/src/html/css/style.css branches/RDR/bigdata-war/src/html/images/logo.png branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/css/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/css/style.css 2014-04-29 13:04:23 UTC (rev 8143) +++ branches/RDR/bigdata-war/src/html/css/style.css 2014-04-29 23:20:01 UTC (rev 8144) @@ -51,7 +51,7 @@ /* Workbench */ body { - margin: 50px 10px; + margin: 10px; background-color: #f1f1f1; font-family: sans-serif; font-size: 80%; @@ -69,7 +69,6 @@ } #container { - max-width: 1000px; margin: 0 auto; } @@ -86,10 +85,6 @@ padding-top: 80px; } -#search-form label { - font-size: 50%; -} - #search-form input { border: 1px solid #e3e3e3; margin: 0; @@ -150,11 +145,11 @@ display: none; clear: both; background: white; + padding: 20px 0; } .box { - padding: 20px 55px; - border-bottom: none; + margin: 20px; overflow-x: scroll; } @@ -226,21 +221,21 @@ box-sizing: border-box; } -label[for=load-type], label[for=rdf-type] { - margin: 0 10px 0 30px; +hr { + background: #929292; + border: none; + height: 5px; + width: 50%; + margin: 20px auto; } -.has-vertical-divider { - line-height: 55px; +#load-load { + margin: 0 auto; + display: block; } -.vertical-divider { - height: 55px; - display: inline-block; - width: 0; - border-left: 1px solid #d7d7d7; - padding-left: 30px; - margin-left: 30px; +#load-buttons { + text-align: center; } .bottom { @@ -255,7 +250,7 @@ border: none; } -#advanced-features, #query-response, #query-pagination, #query-explanation, #query-export-container, #load-response, #load-clear, #explore-results, #namespace-properties { +#advanced-features, #query-response, #query-pagination, #query-explanation, #query-export-container, #load-response, #load-clear-container, #explore-results, #namespace-properties { display: none; } @@ -306,14 +301,6 @@ background-color: red; } -#advanced-features { - margin-right: 50px; -} - -#advanced-features label { - margin-left: 20px; -} - #running-queries li { margin: 10px 0; } @@ -334,103 +321,17 @@ overflow-x: scroll; } -.controls-container { - padding: 25px; -} - -button, input[type=reset], input[type=submit], input[type=file], #load-file-container, select { - width: 110px; - height: 25px; - border: 1px solid #e4e4e4; - color: #616161; -} - -#load-file-container { - display: inline-block; - position: relative; - text-align: center; - line-height: 25px; -} - -#load-file { - position: absolute; - top: 0; - left: 0; - opacity: 0; -} - -input[type=checkbox] { - display: none; -} - -input[type="checkbox"] + label span { - display: inline-block; - width: 13px; - height: 13px; - margin: 0; - vertical-align: middle; - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAIAAAD9iXMrAAAA4UlEQVQoU11RARLCIAzr/1+hMHF7iN6x0rLph0wp9Tx3jLVrSNNALE24YR/PzlwRV9nftTPz42gnt2dj0iaXg5LSTagobWpxOqk02vr8CSiBANGqljsaaznIf95HClZCszLy3GnpVi7B7VCwQgBBShqg62uWs07QXI2g1bB+LgdZjtg0dNOKnvbm0beEmgkNARANB4wv95n/ifMYDmBWgnlewL4Gq6cYyw/DVxIRT5YfVh/rq9L0fflKWAg+H8sDw6kYzu/DTUbZJ0hxGFVgDIuPLeHOirHQBTt8HUHFxWLeD+xTIgvbAhziAAAAAElFTkSuQmCC"); -} - -input[type="checkbox"]:checked + label span { - background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAIAAAD9iXMrAAABb0lEQVQoFQXBTYuNYRjA8f913S/neRyUD2AzRVgoNTsZzUodG76Jz2QpZWEhNmNBaM682KCMEsnCHKYx5nm77+vy+8mbnf1spaZK0ShopQY1XI0qroTkdqoas5VnB+tNwyxikQgFJKAFM8rEauTe2nYE5g1NAy0xIpAdQMCNbuCCEUTVBWugJTf8+ND+/UWc0R/y7VOriWZGO8PdFTQFzgSSIKHbe3S/H3j9ZCGx04gqrrig4qYFALh0Az1/uv3wTpqXy9cJDo5Fqpi6MCZGqII7a5vP//yeX7n1ApgCABBcVZw8IU4A4Oe72+L6dWczCGogaCG4KioiuFDh83tWh+cWDx4frc5+2Q0i4AyRGlzNrFSqcXLMx6271za2YsvVm0/3Xy2Oj6hOHMCqLJfLl9/X85w8oxGqUB0VELynM+oJGxeXMTljhxrSUxM1oAURCmBMI/8GFJW3u3vRJhcVN4jJy6iqSKHmkk1LttDH+h9YiLIwVyNFQAAAAABJRU5ErkJggg=="); -} - -#load-response > pre { - overflow-x: scroll; -} - .clear { clear: both; } -.right { - float: right; -} - -.orange { - background-color: #ffd8b3; - background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#ffd8b3)); - background-image: -webkit-linear-gradient(top, #ffffff, #ffd8b3); - background-image: -moz-linear-gradient(top, #ffffff, #ffd8b3); - background-image: -ms-linear-gradient(top, #ffffff, #ffd8b3); - background-image: -o-linear-gradient(top, #ffffff, #ffd8b3); - background-image: linear-gradient(to bottom, #ffffff, #ffd8b3); - filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffffff, endColorstr=#ffd8b3); -} - -.blue { - background-color: #d3e4f6; - background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#d3e4f6)); - background-image: -webkit-linear-gradient(top, #ffffff, #d3e4f6); - background-image: -moz-linear-gradient(top, #ffffff, #d3e4f6); - background-image: -ms-linear-gradient(top, #ffffff, #d3e4f6); - background-image: -o-linear-gradient(top, #ffffff, #d3e4f6); - background-image: linear-gradient(to bottom, #ffffff, #d3e4f6); - filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffffff, endColorstr=#d3e4f6); -} - -.green { - background-color: #d9e689; - background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#d9e689)); - background-image: -webkit-linear-gradient(top, #ffffff, #d9e689); - background-image: -moz-linear-gradient(top, #ffffff, #d9e689); - background-image: -ms-linear-gradient(top, #ffffff, #d9e689); - background-image: -o-linear-gradient(top, #ffffff, #d9e689); - background-image: linear-gradient(to bottom, #ffffff, #d9e689); - filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#ffffff, endColorstr=#d9e689); -} - #query-pagination { border: 1px solid #e1e1e1; padding: 10px 25px; - margin: 0 55px; - color: #e1e1e1; } #results-per-page { width: 60px; - color: #e1e1e1; } #query-pagination button { @@ -438,10 +339,17 @@ height: 20px; border: 1px solid #e1e1e1; background: transparent; - color: #e1e1e1; } #current-page { border: 1px solid #e1e1e1; - color: #e1e1e1; } + +#query-export-container { + text-align: right; +} + +#load-clear-container { + text-align: right; +} + Modified: branches/RDR/bigdata-war/src/html/images/logo.png =================================================================== (Binary files differ) Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-29 13:04:23 UTC (rev 8143) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-29 23:20:01 UTC (rev 8144) @@ -40,22 +40,17 @@ <div id="load-errors"></div> <textarea id="load-box" placeholder="(Type in or drag a file containing RDF data, a SPARQL update or a file path or URL)"></textarea> </div> - - <div class="controls-container"> - <span id="load-file-container" class="orange">Upload a local file<input type="file" id="load-file"></span> - <button class="orange right">Clear</button> - <p id="large-file-message">Your file <span id="filename"></span> is too large to display here, but will be uploaded as normal. <a href="#" id="clear-file">Remove file</a></p> - </div> - - <div class="controls-container right has-vertical-divider"> - <label for="load-type">TYPE:</label> - <select id="load-type" class="blue"> + <p id="large-file-message">Your file <span id="filename"></span> is too large to display here, but will be uploaded as normal. <a href="#" id="clear-file">Remove file</a></p> + <p> + <input type="file" id="load-file"><br> + <label for="load-type">Type:</label> + <select id="load-type"> <option value="sparql" selected="selected">SPARQL Update</option> <option value="rdf">RDF Data</option> <option value="path">File Path or URL</option> </select> - <label for="rdf-type">FORMAT:</label> - <select id="rdf-type" class="blue"> + <label for="rdf-type">Format:</label> + <select id="rdf-type"> <option value="n-quads">N-Quads</option> <option value="n-triples">N-Triples</option> <option value="n3">Notation3</option> @@ -65,19 +60,20 @@ <option value="trix">TriX</option> <option value="turtle">Turtle</option> </select> - <span class="vertical-divider"> </span> - <button id="load-load" class="green">Load</button> - </div> + </p> + <hr class="shadow"> + <button id="load-load">Load</button> </div> <div class="box" id="load-response"> <pre></pre> - <div class="controls-container right"> - <button id="load-clear" class="orange">Clear output</button> - </div> </div> + <div class="box" id="load-clear-container"> + <button id="load-clear">Clear output</button> + </div> + </div> <div class="tab" id="query-tab"> @@ -90,19 +86,19 @@ <div id="query-errors"></div> <textarea id="query-box" name="query" placeholder="(Input a SPARQL query)"></textarea> - <div class="controls-container"> - <input type="reset" value="Clear" class="orange right"> + <a href="#" id="advanced-features-toggle">Advanced features</a> + + <div id="advanced-features"> + <input type="checkbox" id="query-explain"> <label for="query-explain">Explain</label> + <input type="checkbox" name="analytic" value="true" id="query-analytic"> <label for="query-analytic">Analytic</label> + <input type="checkbox" name="RTO" value="true" id="query-rto"> <label for="query-rto">Runtime Query Optimizer</label> </div> - <div class="controls-container"> - <div class="clear right"> - <a href="#" id="advanced-features-toggle">ADVANCED FEATURES</a>: - <span id="advanced-features"> - <input type="checkbox" id="query-explain"><label for="query-explain"><span></span> EXPLAIN</label> - <input type="checkbox" name="analytic" value="true" id="query-analytic"><label for="query-analytic"><span></span> ANALYTIC</label> - <input type="checkbox" name="RTO" value="true" id="query-rto"><label for="query-rto"><span></span> RUNTIME QUERY OPTIMIZER</label> - </span> - <input type="submit" value="Execute" class="green"> - </div> + + <hr class="shadow"> + + <div id="load-buttons"> + <input type="submit" value="Execute"> + <input type="reset" value="Clear"> </div> </form> @@ -131,10 +127,8 @@ </div> <div id="query-export-container" class="box"> - <div class="controls-container"> - <button id="query-export" class="right orange">Export</button> - <button id="query-response-clear" class="right clear orange">Clear</button> - </div> + <button id="query-export">Export</button> + <button id="query-response-clear">Clear</button> </div> </div> @@ -172,8 +166,6 @@ <div class="box" id="explore-attributes"></div> </div> - <div class="bottom"></div> - </div> <div class="tab" id="status-tab"> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-29 13:04:23 UTC (rev 8143) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-29 23:20:01 UTC (rev 8144) @@ -919,7 +919,6 @@ // clear tables $('#explore-incoming, #explore-outgoing, #explore-attributes').html('<table>'); - $('#explore-tab .bottom').hide(); $('#explore-results, #explore-results .box').show(); // go through each binding, adding it to the appropriate table @@ -1026,7 +1025,6 @@ } function updateExploreError(jqXHR, textStatus, errorThrown) { - $('#explore-tab .bottom').show(); $('#explore-results .box').html('').hide(); $('#explore-header').text('Error! ' + textStatus + ' ' + jqXHR.statusText); $('#explore-results, #explore-header').show(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <tob...@us...> - 2014-04-29 23:37:04
|
Revision: 8145 http://sourceforge.net/p/bigdata/code/8145 Author: tobycraig Date: 2014-04-29 23:37:02 +0000 (Tue, 29 Apr 2014) Log Message: ----------- Improved pagination Modified Paths: -------------- branches/RDR/bigdata-war/src/html/index.html branches/RDR/bigdata-war/src/html/js/workbench.js Modified: branches/RDR/bigdata-war/src/html/index.html =================================================================== --- branches/RDR/bigdata-war/src/html/index.html 2014-04-29 23:20:01 UTC (rev 8144) +++ branches/RDR/bigdata-war/src/html/index.html 2014-04-29 23:37:02 UTC (rev 8145) @@ -109,12 +109,12 @@ </div> <div id="query-pagination" class="box"> - <span id="current-results"></span> + Total results: <span id="total-results"></span>, displaying <span id="current-results"></span> <select id="results-per-page"> - <option>10</option> <option>25</option> - <option>50</option> + <option selected>50</option> <option>100</option> + <option>all</option> </select> per page <div id="page-selector"> <button id="previous-page">◀</button> Modified: branches/RDR/bigdata-war/src/html/js/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-29 23:20:01 UTC (rev 8144) +++ branches/RDR/bigdata-war/src/html/js/workbench.js 2014-04-29 23:37:02 UTC (rev 8145) @@ -2,7 +2,7 @@ // global variables var DEFAULT_NAMESPACE, NAMESPACE, NAMESPACE_URL, NAMESPACES_READY, NAMESPACE_SHORTCUTS, FILE_CONTENTS, QUERY_RESULTS; -var PAGE_SIZE=10, TOTAL_PAGES, CURRENT_PAGE; +var PAGE_SIZE = 50, TOTAL_PAGES, CURRENT_PAGE; /* Modal functions */ @@ -686,6 +686,7 @@ thead.append(tr); table.append(thead); + $('#total-results').html(data.results.bindings.length); setNumberOfPages(); showPage(1); @@ -737,9 +738,13 @@ } function setPageSize(n) { - n = parseInt(n, 10); - if(typeof n != 'number' || n % 1 != 0 || n < 1 || n == PAGE_SIZE) { - return; + if(n == 'all') { + n = QUERY_RESULTS.results.bindings.length; + } else { + n = parseInt(n, 10); + if(typeof n != 'number' || n % 1 != 0 || n < 1 || n == PAGE_SIZE) { + return; + } } PAGE_SIZE = n; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |