Documentation
Autosave
autosave.before.send #
xhr | Object | XMLHttpRequest object |
name | String | Textarea name or value from the 'autosave.name' option |
data | Object | Object with data sent to the server |
Occurs before sending the autosave request to the server.
This event has event.stop
method.
ArticleEditor('#entry', {
css: '/your-article-dist-path/',
subscribe: {
'autosave.before.send': function(event) {
var xhr = event.get('xhr');
xhr.setRequestHeader('X-CSRF-Token', 'your-token-value');
}
}
});
autosave.send #
response | Object | JSON response |
name | String | Textarea name or value from the 'autosave.name' option |
data | Object | Object with data sent to the server |
Occurs whenever the autosave request is sent.
ArticleEditor('#entry', {
css: '/your-article-dist-path/',
subscribe: {
'autosave.send': function(event) {
...
}
}
});
autosave.error #
response | Object | JSON response |
name | String | Textarea name or value from the 'autosave.name' option |
data | Object | Object with data sent to the server |
Occurs when the autosave request fails.
ArticleEditor('#entry', {
css: '/your-article-dist-path/',
subscribe: {
'autosave.error': function(event) {
...
}
}
});
Here is the example of JSON error response:
{
"error": true,
"message": "Something went wrong..."
}