Skip to content
Browse files

reverting

  • Loading branch information...
1 parent 0ede4eb commit c2c78a4a1fe1afefca1698a5a0dd913cf6bd5397 @peterneubauer peterneubauer committed Apr 9, 2012
Showing with 10 additions and 43 deletions.
  1. +4 −13 src/main/webapp/index.html
  2. +6 −23 src/main/webapp/javascripts/console.js
  3. +0 −7 src/main/webapp/stylesheets/main.css
View
17 src/main/webapp/index.html
@@ -4,14 +4,7 @@
<title>Neo4j Console</title>
<script type="text/javascript" src="javascripts/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="javascripts/d3.min.js"></script>
-
- <!--ace editor-->
- <script src="http://akollegger.github.com/ace/build/src/ace.js" type="text/javascript" charset="utf-8"></script>
- <script src="http://akollegger.github.com/ace/build/src/theme-twilight.js" type="text/javascript" charset="utf-8"></script>
- <script src="http://akollegger.github.com/ace/build/src/mode-cypher.js" type="text/javascript" charset="utf-8"></script>
-
-
- <script type="text/javascript" src="javascripts/visualization.js"></script>
+ <script type="text/javascript" src="javascripts/visualization.js"></script>
<script type="text/javascript" src="javascripts/console.js"></script>
<style type="text/css">
@import url("stylesheets/main.css");
@@ -26,12 +19,10 @@
<img title="Toggle Vizualization" onclick="toggleGraph();" class="graph button" src="img/graph.png"/>
<pre id="output" class="console">
</pre>
- <button id="submitQuery">Execute Cypher (Ctrl-E)</button>
- <!--form id="form" action="#">
+ <form id="form" action="#">
<input class="console" type="text" name="text" size="180" value="start n=node(*) return n"/>
- </form-->
- <div id="editor"></div>
- <div id="graph">
+ </form>
+ <div id="graph">
</div>
<div id="info">
This is an interactive console (REPL) for graphs with integrated visualization.
View
29 src/main/webapp/javascripts/console.js
@@ -20,7 +20,6 @@ function post(uri, data, done) {
}
});
}
-
function getParameters() {
var pairs = window.location.search.substr(1).split('&');
if (!pairs) return {};
@@ -70,31 +69,12 @@ function toggleGraph() {
$(document).ready(function () {
console.log("parameters"+window.location.search);
-
- //initialize the editor
- var editor = ace.edit("editor");
- //editor.setTheme("ace/theme/twilight");
- var CypherMode = require("ace/mode/cypher").Mode;
- editor.getSession().setMode(new CypherMode());
-
$.ajax("/console/init"+window.location.search, {type:"GET", success: function(json) {
var data=$.parseJSON(json);
append($("#output"), data.init);
append($("#output"), data.geoff);
append($("#output"), data.result);
- console.log(data.query);
- editor.getSession().setValue(data.query);
- editor.commands.addCommand({
- name: 'execute',
- bindKey: {
- win: 'Ctrl-E',
- mac: 'Ctrl-E'
- },
- exec: function(editor) {
- $("#submitQuery").click();
- }
- });
- editor.focus();
+ $("#form input").val(data.query);
viz(data.vizualization);
}});
/*
@@ -111,10 +91,13 @@ $(document).ready(function () {
);
});
*/
- $("#submitQuery").click(function (){
- post(isCypher(editor.getSession().getValue()) ? "/console/cypher" : "/console/geoff", editor.getSession().getValue(), function () {
+ $("#form").submit(function () {
+ var query = $("#form input").val();
+ var url = isCypher(query) ? "/console/cypher" : "/console/geoff";
+ post(url, query, function () {
viz();
});
return false;
});
+ $("#form input").focus();
});
View
7 src/main/webapp/stylesheets/main.css
@@ -58,13 +58,6 @@ a:link, a:visited {
padding: 20px;
}
-#editor {
- width: 100%;
- height: 10%;
- margin: 0;
- border: none;
-}
-
.button {
z-index: 100;
position: absolute;

0 comments on commit c2c78a4

Please sign in to comment.
Something went wrong with that request. Please try again.