Webapp; isDirty checking
Posted: Mon Aug 29, 2016 7:12 pm
Hi !!!
I use this function to check isDirty status.
This event change to TRUE in many situation:
1) Change text
2) Set ReadOnly mode thru:
3) Use my own action, even empty:
But I need take only text changing. How can I separate them?
I use this function to check isDirty status.
Code: Select all
goog.events.listen(editor, sync.api.Editor.EventTypes.DIRTY_STATUS_CHANGED, function(e) {
sendIsDirtyToApplication(e.isDirty);
}
1) Change text
2) Set ReadOnly mode thru:
Code: Select all
editor.getActionsManager().invokeOperation(
'SetReadOnlyStatusOperation',
{'read-only': data.value}
);
Code: Select all
SaveAction.prototype.actionPerformed = function(callback) {
new sync.ops.ServerOperation("webapp.extention.action.SaveAction", editor.controller).doOperation(callback, {
editorUID: window.editorUID
}, null);
Code: Select all
public class SaveAction implements AuthorOperation {
@Override
public void doOperation(AuthorAccess authorAccess, ArgumentsMap argumentsMap) throws IllegalArgumentException, AuthorOperationException {
}
@Override
public String getDescription() {
return null;
}
@Override
public ArgumentDescriptor[] getArguments() {
return null;
}
}
Code: Select all
goog.events.listen(editor, sync.api.Editor.EventTypes.DIRTY_STATUS_CHANGED, function(e) {
sendSetDirty(e.isDirty);
});