Notes
This commit is contained in:
83
masks/course.html
Normal file
83
masks/course.html
Normal file
@@ -0,0 +1,83 @@
|
||||
<div id="course">
|
||||
<div id="docs"></div>
|
||||
<div id="notes_box">
|
||||
<div id="notes_feedback"></div>
|
||||
<div id="notes"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
oCATC.pageInit = function(asHash, bFirstPage) {
|
||||
self.setPageTitle('Course');
|
||||
self.tmp('id_course', asHash.items[0]);
|
||||
|
||||
oEditor = new Editor('#notes');
|
||||
oEditor.onKeyStroke = (e) => {
|
||||
if(e.which == 83 && e.ctrlKey) {
|
||||
e.preventDefault();
|
||||
save(true);
|
||||
}
|
||||
else save();
|
||||
}
|
||||
oEditor.open(self.tmp('id_course'));
|
||||
//oQuill.keyboard.addBinding({key: 'S', ctrlKey: true}, function(){saveNotes(true);});
|
||||
};
|
||||
|
||||
oCATC.onQuitPage = function() {
|
||||
return save(true);
|
||||
};
|
||||
|
||||
oCATC.onFeedback = function(sType, sMsg)
|
||||
{
|
||||
var $Feedback = $('#notes_feedback').stop();
|
||||
if(sMsg != $Feedback.find('span').text()) {
|
||||
$Feedback.fadeOut($Feedback.is(':empty')?0:'fast', function(){
|
||||
$(this)
|
||||
.empty()
|
||||
.append($('<span>', {'class':sType}).text(sMsg))
|
||||
.fadeIn('fast');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function save(bForce)
|
||||
{
|
||||
if(typeof oSaveTimer != 'undefined') clearTimeout(oSaveTimer);
|
||||
var bSave = (oEditor.keystrokes % 20 == 0 || bForce);
|
||||
|
||||
if(bSave) {
|
||||
if(self.tmp('saving')) {
|
||||
oSaveTimer = setTimeout(function(){save(true);}, 500);
|
||||
}
|
||||
else {
|
||||
var sContent = oEditor.getContent();
|
||||
if(oEditor.id != 0) {
|
||||
self.tmp('saving', true);
|
||||
oCATC.onFeedback('info', 'Saving...');
|
||||
getInfo(
|
||||
'set_note',
|
||||
function(sDesc, asData) {
|
||||
oCATC.feedback('notice', 'Note saved ('+asData.led.substr(11, 5)+')');
|
||||
self.tmp('saving', false);
|
||||
},
|
||||
{
|
||||
id: oEditor.id,
|
||||
content: sContent
|
||||
},
|
||||
function(sError) {
|
||||
oCATC.feedback('error', 'Not saved! An error occured: '+sError);
|
||||
self.tmp('saving', false);
|
||||
oSaveTimer = setTimeout(save, 1000);
|
||||
},
|
||||
'POST'
|
||||
);
|
||||
}
|
||||
else oCATC.feedback('error', 'No Course ID');
|
||||
}
|
||||
}
|
||||
else {
|
||||
oSaveTimer = setTimeout(function(){save(true);}, 1000*10);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -5,7 +5,7 @@
|
||||
</div>
|
||||
<div id="menu">
|
||||
<ul>
|
||||
<li><a href="#" class="button fal fa-home"></a></li><li><a href="#logoff" class="button fal fa-logoff"></a></li>
|
||||
<li><a href="#workshops" class="button fal fa-home"></a></li><li><a href="#logoff" class="button fal fa-logoff"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="main_title"><h1></h1></div>
|
||||
|
||||
Reference in New Issue
Block a user