setInterval(function() {
if (CHANGE.length() > 0) {
console.log('Saving changes', CHANGE);
- /*
- Send partial changes
- $.post('/your-endpoint', {
- partial: JSON.stringify(change)
- });
-
- Send entire document
- $.post('/your-endpoint', {
- doc: JSON.stringify(QUILL.getContents())
- });
- */
CHANGE = new Delta();
}
}, 10 * 1000);
}
RTF_SUBMIT = true;
var bg = $("#fldBG").val();
- $.post('json.cgi', {action:'store', id:id, bg:bg, doc: JSON.stringify(QUILL.getContents())}, saveRTFResult);
+ $.post('json.cgi', {action:'store', id:id, bg:bg, doc: JSON.stringify(QUILL.getContents())},saveRTFResult).fail(
+ function(response) {dialogModal("Server Error: "+response.status,response.responseText);});
if(is_submit){
//we must wait before submitting actual form!
$("#idx_cat").value = "SAVING DOCUMENT...";
return false;
}
-function delayedSubmit(){
- if(RTF_SUBMIT){
- setTimeout(delayedSubmit, 200);
- return;
- }
- $("#frm_entry").submit();
-}
-
-function saveRTFResult(result) {
- //alert("Result->" + result);
+function saveRTFResult(result) {
console.log("Result->" + result);
var obj = JSON.parse(result);
//alert(obj.response);
RTF_SUBMIT = false;
}
+function delayedSubmit(){
+ if(RTF_SUBMIT){
+ setTimeout(delayedSubmit, 200);
+ return;
+ }
+ $("#frm_entry").submit();
+}
+
+
function loadRTF(under, id){
//show under log entry the document
}
//var json = "[{'insert': 'Loading Document...', 'attributes': { 'bold': true }}, {'insert': '\n'}]";
- QUILL.setText('Loading Document...\n');
- $.post('json.cgi', {action:'load', id:id}, loadRTFResult);
+ QUILL.setText('Loading Document...\n');
+ $.post('json.cgi', {action:'load', id:id}, loadRTFResult).fail(
+ function(response) {dialogModal("Server Error: "+response.status,response.responseText);}
+ );
+
$("#rtf_doc").show();
$('#tbl_doc').show();
$('#toolbar-container').show();
modal: true,
title: title,
width: "40%",
- show: { effect: "clip", duration: 800 },
+ show: { effect: "clip", duration: 400 },
open: function() {
$(this).html(message);
},