0
0
mirror of https://github.com/Doodle3D/doodle3d-connect.git synced 2024-07-05 04:20:43 +02:00
doodle3d-connect/js/api/ServerAPI.js
2017-06-20 21:42:18 +02:00

39 lines
866 B
JavaScript

/*
* This file is part of the Doodle3D project (http://doodle3d.com).
*
* Copyright (c) 2013, Doodle3D
* This software is licensed under the terms of the GNU GPL v2 or later.
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
*/
function ServerAPI() {
var _apiURL = "";
var _timeoutTime = 6000;
this.init = function(url) {
_apiURL = url;
}
this.getInfo = function(uuid, completeHandler, failedHandler) {
console.log("ServerAPI:getInfo");
$.ajax({
url: _apiURL + "/info/" + uuid,
type: "GET",
dataType: 'json',
timeout: _timeoutTime,
cache: false,
success: function(response) {
if (completeHandler) completeHandler(response);
}
}).fail(function(response) {
console.log("fail");
if (failedHandler) failedHandler();
});
};
// '/fetch/'+uid.value+'/'+line.value;
}