Skip to content

Commit

Permalink
[api] hooked up exports to execution plan. export popup is kinda work…
Browse files Browse the repository at this point in the history
…ing again
  • Loading branch information
Marak committed Sep 10, 2010
1 parent 944af2c commit 5bd9ea1
Showing 1 changed file with 32 additions and 24 deletions.
56 changes: 32 additions & 24 deletions client/js/app.js
Expand Up @@ -39,6 +39,7 @@ $(function() {
plan: [ /* execution plan */

"splash"
,"export"
,"pageLoad"
,"setupMilestones"
,"codeview"
Expand Down Expand Up @@ -89,7 +90,6 @@ $(function() {
},

keyDown: function(e) {
//console.log(e.which);
var events = doc.data('events');
for(var eventName in events){
for(var i = 0; i < events[eventName].length; i++){
Expand Down Expand Up @@ -331,29 +331,6 @@ $(function() {
}
}
});

doc.bind('ws.submitAST', function(e, callback){
$.ajax({
url: '/export', /* TODO: Need real URL to submit to */
type: "POST",
dataType: "JSON",
data: JSON.stringify(NJ.nup.DATA.features),
success: function(data) {
callback(JSON.parse(data));
}
});
});

$("footer").click(function() {
// put ajax post here
doc.trigger('ws.submitAST', function(rsp){
//console.log(rsp[0].text);
$('#export-stubs code').html(rsp[0].text);
hijs();
$('#export-stubs').dialog("open");

});
});

},

Expand Down Expand Up @@ -451,6 +428,23 @@ $(function() {
this.bindScenarios();
this.bindSteps();


// webservice bindings
this.bindWS();


$("footer").click(function() {
// put ajax post here
doc.trigger('ws.submitAST', function(rsp){
//console.log(rsp[0].text);
$('#export-stubs code').html(rsp[0].text);
hijs();
$('#export-stubs').dialog("open");

});
});


// TO-DO: touch binding...

},
Expand Down Expand Up @@ -594,6 +588,20 @@ $(function() {

},

bindWS: function() {
doc.bind('ws.submitAST', function(e, callback){
$.ajax({
url: '/export', /* TODO: Need real URL to submit to */
type: "POST",
dataType: "JSON",
data: JSON.stringify(NJ.nup.DATA.features),
success: function(data) {
callback(JSON.parse(data));
}
});
});
},

features: function() {

$("#featureslist input, #projectTitle").live("mouseover", function() {
Expand Down

0 comments on commit 5bd9ea1

Please sign in to comment.