Add user id to docs/todos/notes tables

This commit is contained in:
2019-09-07 12:38:37 +02:00
parent 81a17332b4
commit 42c6f8eff7
6 changed files with 97 additions and 55 deletions

View File

@@ -10,6 +10,7 @@ oCATC.pageInit = function(asHash, bFirstPage) {
self.setPageTitle('Course');
self.tmp('id_course', asHash.items[0]);
//Setup Quill
oEditor = new Editor('#notes');
oEditor.onKeyStroke = (e) => {
if(e.which == 83 && e.ctrlKey) {
@@ -17,8 +18,19 @@ oCATC.pageInit = function(asHash, bFirstPage) {
save(true);
}
else save();
}
oEditor.open(self.tmp('id_course'));
};
//Load notes
Tools.ajax(
'get_note',
(asData) => {
oEditor.setContent(asData.ops);
oCATC.feedback('notice', 'Last update on ('+asData.led.substr(11, 5)+')');
},
{id: self.tmp('id_course')},
() => {console.log('Note not found for course ID = '+self.tmp('id_course'))}
);
//oQuill.keyboard.addBinding({key: 'S', ctrlKey: true}, function(){saveNotes(true);});
};
@@ -60,7 +72,7 @@ function save(bForce)
self.tmp('saving', false);
},
{
id: oEditor.id,
id: self.tmp('id_course'),
content: sContent
},
function(sError) {
@@ -75,7 +87,7 @@ function save(bForce)
}
}
else {
oSaveTimer = setTimeout(function(){save(true);}, 1000*10);
oSaveTimer = setTimeout(function(){save(true);}, 1000*5);
}
return true;
}