From: <tob...@us...> - 2014-02-19 01:47:37
|
Revision: 7850 http://bigdata.svn.sourceforge.net/bigdata/?rev=7850&view=rev Author: tobycraig Date: 2014-02-19 01:47:28 +0000 (Wed, 19 Feb 2014) Log Message: ----------- Initial new layout with most load functionality Modified Paths: -------------- branches/RDR/bigdata-war/src/html/workbench.js Added Paths: ----------- branches/RDR/bigdata-war/src/html/new.html branches/RDR/bigdata-war/src/html/style.css Added: branches/RDR/bigdata-war/src/html/new.html =================================================================== --- branches/RDR/bigdata-war/src/html/new.html (rev 0) +++ branches/RDR/bigdata-war/src/html/new.html 2014-02-19 01:47:28 UTC (rev 7850) @@ -0,0 +1,69 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <title>RedPoint Workbench</title> + <link rel="stylesheet" href="style.css"> + </head> + + <body> + <div id="tab-selector"> + <a data-target="load" class="active">Load</a> + <a data-target="query">Query</a> + <a data-target="explore">Explore</a> + <a data-target="status">Status</a> + <a data-target="namespaces">Namespaces</a> + </div> + + <div id="current-namespace"> + Current namespace: <span>kb</span> + </div> + + <div class="tab" id="load"> + <input id="load-file" type="file" name="file"> + <input id="load-hidden" type="hidden" name="large-file-contents"> + <p id="large-file-message" style="display: none;">Your file is too large to display here, but will be uploaded as normal.</p> + <br> + <textarea id="load-box" name="textarea" rows="10" cols="80"></textarea> + <br> + Type: <select id="load-type"> + <option value="sparql" selected="selected">SPARQL</option> + <option value="rdf">RDF</option> + <option value="path">File path</option> + </select> + <select id="rdf-type" style="display: none;"> + <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> + <br> + <button>Load</button> + <hr> + <p>Response:</p> + <pre id="response"></pre> + + </div> + + <div class="tab" id="query">query + </div> + + <div class="tab" id="explore">explore + </div> + + <div class="tab" id="status">status + </div> + + <div class="tab" id="namespaces">namespaces + </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="/jquery.min.js"><\/script>')</script> + <script src="workbench.js"></script> + </body> +</html> Property changes on: branches/RDR/bigdata-war/src/html/new.html ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:keywords + Id Date Revision Author HeadURL Added: branches/RDR/bigdata-war/src/html/style.css =================================================================== --- branches/RDR/bigdata-war/src/html/style.css (rev 0) +++ branches/RDR/bigdata-war/src/html/style.css 2014-02-19 01:47:28 UTC (rev 7850) @@ -0,0 +1,84 @@ +/* http://meyerweb.com/eric/tools/css/reset/ + v2.0 | 20110126 + License: none (public domain) +*/ + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + + +/* Workbench */ + +body { + margin: 10px; +} + +#tab-selector a { + padding: 10px; + border: 1px solid; + border-right: none; + border-bottom: none; + display: inline-block; + float: left; +} + +#tab-selector a:last-of-type { + border-right: 1px solid; +} + +#current-namespace { + float: right; +} + +.active { + text-shadow: 1px 0px 0px black; + /*font-weight: bold;*/ +} + +.tab { + display: none; + clear: both; + border: 1px solid; + padding: 10px; +} Modified: branches/RDR/bigdata-war/src/html/workbench.js =================================================================== --- branches/RDR/bigdata-war/src/html/workbench.js 2014-02-17 19:20:06 UTC (rev 7849) +++ branches/RDR/bigdata-war/src/html/workbench.js 2014-02-19 01:47:28 UTC (rev 7850) @@ -1,5 +1,26 @@ -/* Multi purpose data entry */ +$(function() { +$('#tab-selector a').click(function() { + $('.tab').hide(); + $('#' + $(this).data('target')).show(); + $('#tab-selector a').removeClass(); + $(this).addClass('active'); +}); + +$('#tab-selector a:first').click(); + +// TODO: set namespace initially + +/* Namespaces */ + +function getNamespaces() { + $.get('/namespace', function(data) { + + }); +} + +/* Load */ + function handleDragOver(e) { e.stopPropagation(); e.preventDefault(); @@ -26,22 +47,22 @@ // if file is too large, tell user to supply local path if(f.size > 100 * 1048576) { alert('File too large, enter local path to file'); - $('#mp-box').val('/path/to/' + f.name); + $('#load-box').val('/path/to/' + f.name); setType('path'); - $('#mp-file').val(''); + $('#load-file').val(''); $('#large-file-message').hide(); return; } // if file is small enough, populate the textarea with it if(f.size < 10 * 1024) { - holder = '#mp-box'; - $('#mp-hidden').val(''); + holder = '#load-box'; + $('#load-hidden').val(''); $('#large-file-message').hide(); } else { // store file contents in hidden input and clear textarea - holder = '#mp-hidden'; - $('#mp-box').val(''); + holder = '#load-hidden'; + $('#load-box').val(''); $('#large-file-message').show(); } var fr = new FileReader(); @@ -50,7 +71,7 @@ guessType(f.name.split('.').pop().toLowerCase(), e2.target.result); }; fr.readAsText(f); - $('#mp-file').val(''); + $('#load-file').val(''); } function guessType(extension, content) { @@ -100,7 +121,7 @@ } function setType(type, format) { - $('#mp-type').val(type); + $('#load-type').val(type); if(type == 'rdf') { $('#rdf-type').show(); $('#rdf-type').val(format); @@ -133,15 +154,15 @@ var sparql_update_commands = ['INSERT', 'DELETE']; // stores the id of the element that contains the data to be sent -var holder = '#mp-box'; +var holder = '#load-box'; -$('#mp-file').change(handleFile); -$('#mp-box').on('dragover', handleDragOver); -$('#mp-box').on('drop', handleFile); -$('#mp-box').on('paste', handlePaste); -$('#mp-type').change(handleTypeChange); +$('#load-file').change(handleFile); +$('#load-box').on('dragover', handleDragOver); +$('#load-box').on('drop', handleFile); +$('#load-box').on('paste', handlePaste); +$('#load-type').change(handleTypeChange); -$('#mp-send').click(function() { +$('#load button').click(function() { // determine action based on type var settings = { type: 'POST', @@ -149,7 +170,7 @@ success: updateResponseXML, error: updateResponseError } - switch($('#mp-type').val()) { + switch($('#load-type').val()) { case 'sparql': settings.data = 'update=' + encodeURI(settings.data); settings.success = updateResponseHTML; @@ -170,11 +191,11 @@ $.ajax('/sparql', settings); }); -function updateResponseHTML(data, textStatus, jqXHR) { +function updateResponseHTML(data) { $('#response').html(data); } -function updateResponseXML(data, textStatus, jqXHR) { +function updateResponseXML(data) { var modified = data.childNodes[0].attributes['modified'].value; var milliseconds = data.childNodes[0].attributes['milliseconds'].value; $('#response').text('Modified: ' + modified + '\nMilliseconds: ' + milliseconds); @@ -236,7 +257,7 @@ $.ajax('/sparql', settings); } -function updateNavigationStart(data, textStatus, jqXHR) { +function updateNavigationStart(data) { var disp = $('#navigator-display'); disp.html(''); // see if we got any results @@ -295,3 +316,4 @@ $('#navigator-display').html('Error! ' + textStatus + ' ' + errorThrown); } +}); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |