1

I'm using TinyMCE in a Filemaker file. I'd like to save changes when typing, or if formatting is applied, or for example, a list is applied or an image inserted. No matter what the changes.

I want to call a function in my init script, when changes are made... BUT ... I don't want it to be too frantic, because it slows down Filemaker too much.

I found this snippet which works very well for typing, because of it managing the keyup timeout. However, it doesn't work for other changes, e.g. adding formatting. I have it set to run a function further down, which triggers a Filemaker script (saveTEMP).

var keypupTimer
tinymce.init({
selector: '#GSNotes',

setup : function(ed) {
        ed.on('keyup', function (e) {    
            clearTimeout(keypupTimer);
            keypupTimer = setTimeout( saveTEMP, 1000);                
        });                    
    },

Questions:

1/ How can I adapt it to cater to edits other than typing/keyboard?

2/ Is this the best method for me to use? Would something like BLUR be better?

Many thanks for any help/pointers

GSymon
  • 25
  • 4

1 Answers1

1

There seems to be a FormatApply event provided by TinyMCE, or maybe even ExecCommand.

This should be an helpful ressource to run more tests: https://www.tiny.cloud/docs/advanced/events/

Regarding the keyboard input event blur would only trigger when you change field.

keyup seems fine event though a bit specific, input is more generic.

Jean Will
  • 543
  • 3
  • 11