Add user id to docs/todos/notes tables
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user