Permalink
Browse files

Removed image dependency. Now the target of the post is the iframe!

FINALLY! The POST method!
  • Loading branch information...
Gianfrancoalongi committed Mar 30, 2013
1 parent cb862b1 commit 1e27414478702fb0ecd08f1c6dfbd5cd81274e2a
Showing with 14 additions and 8 deletions.
  1. +9 −7 engine.js
  2. +5 −1 index.html
View
@@ -5,14 +5,13 @@ var ADD_OUTPUT = 'add_output';
var REMOVE_MUTATOR_NODE = 'remove_mutator_node';
var REMOVE_OUTPUT_NODE = 'remove_output_node';
-function new_graph(img_id) {
+function new_graph() {
var graph = {
paths: [[STDIN,STDOUT]],
files: [],
mutators: [],
- img_id: img_id,
history: [],
newly_added_mutator:[],
@@ -416,22 +415,25 @@ function new_graph(img_id) {
make_graphviz_graph: function()
{
+ var URL = 'https://chart.googleapis.com/chart';
var shape_dot_code = this.generate_shape_dot_code();
var paths_dot_code = this.generate_paths_dot_code();
var dot_code = 'strict digraph gr{ '
+ shape_dot_code
+ paths_dot_code
+ ' }';
- var options = {cht: "gv", chl: dot_code };
- var request = "https://chart.googleapis.com/chart?"+$.param(options);
- $('#'+this.img_id).attr('src',request);
+ $("<form action="+URL+" method='POST' target='graph_frame'></form>")
+ .append("<input type='hidden' name='cht' value='gv'/>")
+ .append("<input type='hidden' name='chl' value='"+dot_code+"'/>")
+ .appendTo('body')
+ .submit()
+ .remove();
}
-
};
return graph;
}
-var graph = new_graph('graph_img');
+var graph = new_graph();
function switch_the_button_into_done_button() {
$('#the_button').attr('value',"Done");
View
@@ -20,16 +20,20 @@
width:auto;
margin:5;
background:white;
+ height: 90%;
+ width: 90%;
}
#left {
margin: 5;
float:left;
width:30%;
+ height: 100%;
background:white;
}
#right {
float:right;
width:70%;
+ height: 100%;
background:white;
border-color: #f0a35d;
}
@@ -42,7 +46,7 @@
</p>
<div id="left" align="center"> </div>
<div id="right" align="left">
- <img id="graph_img"/>
+ <iframe id="graph_frame" width="100%" height="90%" display="block"></iframe>
</div>
</div>
<script>

0 comments on commit 1e27414

Please sign in to comment.