X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FAPI.js;h=30dc7b51534388267ab60ebb14775c1fd83e9f1b;hb=fc5b9f1f68322c876b331c049749f113eb0271f7;hp=a5aa965100ab75fd91bc344cec2329f4a0fe950f;hpb=4720a1f90f7d42f3611f064cc5ba3d768a92b5c6;p=blerg.git diff --git a/www/jssrc/blerg/API.js b/www/jssrc/blerg/API.js index a5aa965..30dc7b5 100644 --- a/www/jssrc/blerg/API.js +++ b/www/jssrc/blerg/API.js @@ -222,4 +222,27 @@ enyo.kind({ username: blerg.API.username }); }, + post: function(data) { + var req = new enyo.Ajax({ + url: baseURL + '/put', + method: 'POST' + }); + req.response(function(inSender, inResponse) { + if (inResponse && inResponse.status == 'success') { + this.bubble('onPostSuccessful', { + username: blerg.API.username, + data: data + }); + } else { + this.bubble('onPostFailed', { + username: blerg.API.username, + data: data + }); + } + }.bind(this)); + req.go({ + username: blerg.API.username, + data: data + }); + } });