aseprite/data/www/aseprite.js
David Capello d259b5c394 Add experimental webserver API and home page
Added webserver::IRequest/IResponse/IDelegate interfaces.
2013-04-01 19:37:02 -03:00

23 lines
532 B
JavaScript

window.Aseprite = window.Aseprite || {};
(function(Aseprite) {
'use strict';
Aseprite.host = 'http://127.0.0.1:10453';
Aseprite.get = function(uri, callback) {
$.ajax({
type: 'GET',
url: Aseprite.host + uri,
dataType: 'json',
cache: false,
success: function(data) {
callback(data);
}
});
}
Aseprite.get_version = function(callback) {
Aseprite.get('/version', callback);
}
})(window.Aseprite);