/* * Checks if a file exists **/ function fileExists(file) { var result; $.ajax({ url: "./" + file, type: "GET", timeout: 3000, async: false, success: function() { result = true; }, error: function() { result = false; } }); return result; } function getFileContent(file) { var content; $.ajax({ url: "./" + file, type: "GET", timeout: 3000, async: false, success: function(data) { content = data; }, error: function() { return null; } }); return content; } function createFile(data) { var data = data; data.command = "file_create"; $.ajax({ url: "./code/php/serverside.php", timeout: 3000, type: "POST", data: data, success: function(reply) { console.debug("AJAX REPLY: " + reply); }, error: function() { return null; } }); } function getFolderFiles(data) { var data = data; data.command = "directory_list"; var content; $.ajax({ url: "./code/php/serverside.php", timeout: 3000, type: "POST", data: data, async: false, dataType: "json", success: function(reply) { content = reply; }, error: function(reply) { console.debug(reply.responseText); return null; } }); return content; }