Begin registering logic implementation.

This commit is contained in:
Florent Galland
2013-01-04 19:01:26 +01:00
parent 12f32a624a
commit aaecbf8679
2 changed files with 22 additions and 0 deletions

View File

@@ -21,6 +21,13 @@
/*if(!empty($_GET['action'])){ $action = $_GET['action']; }
else{ exit('{"status":"error","data":{"error":"No Action Specified"}}'); }*/
if (isset($_POST["action"]) && !empty($_POST["action"])) {
$data = json_decode($_POST["action"]);
/*touch(BASE_PATH . "/data/pipi");
touch(BASE_PATH . "/data/" . $data['filename'] . '_' . $_SESSION['user']);*/
echo json_encode($data);
}
if (isset($_POST["change"]) && !empty($_POST["change"])) {
$data = json_decode($_POST["change"]);
echo json_encode($data);

View File

@@ -30,7 +30,22 @@
this.$onCursorChange = this.onCursorChange.bind(this);
},
registerAsCollaboratorOfActiveFile: function () {
var post = { action: 'register', filename: 'toto' };
$.ajax({
type: 'POST',
url: this.controller,
// data: post,
data: { action: 'register', filename: codiad.active.getPath() },
complete: function (data) {
console.log('complete registering');
console.log(data);
}
});
},
addListeners: function () {
this.registerAsCollaboratorOfActiveFile();
this.addListenerToOnDocumentChange();
this.addListenerToOnCursorChange();
},