Skip to content

Commit

Permalink
Remove the addnode method for once and for all
Browse files Browse the repository at this point in the history
Stop using the JsonController and talk to each controller directly in a RESTful
way.
  • Loading branch information
Daniel Martin committed Jul 5, 2011
1 parent 2dd340d commit 8aba2e7
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions public/javascripts/thebrain.js
@@ -1,36 +1,5 @@
// TODO: think REST please!!!
// TODO: this should be an object, not functions

//------------------------------------------------------------------------ nodes
function addnode(node, callback) {
var parent = node.parentNode;
var p = {
label: node.text
};
if (parent.id != 'root-node') {
p.parent_id = parent.id
}
Ext.Ajax.request({
url: 'json/node_create',
params: p,
success: function(response, options) {
dradisstatus.setStatus({
text: 'New node sent to the server',
clear: 5000
});
dradis.revision += 1;
callback(response.responseText);
},
failure: function(response, options) {
dradisstatus.setStatus({
text: 'An error occured with the Ajax request',
iconCls: 'error',
clear: 5000
});
}
});
}

//------------------------------------------------------------------------ revision poller

function checkrevision(interval) {
Expand Down

0 comments on commit 8aba2e7

Please sign in to comment.