mirror of
https://github.com/Codiad/Codiad.git
synced 2026-03-14 13:06:55 +01:00
Begin registering logic implementation.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user