Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better draft handling #2415

Merged
merged 5 commits into from Jun 14, 2018
Merged

Better draft handling #2415

merged 5 commits into from Jun 14, 2018

Conversation

micgro42
Copy link
Collaborator

@micgro42 micgro42 commented Jun 8, 2018

This implements many of the same features as #2413, but in a cleaner way.
This adds a new Draft class and uses that for all draft-related actions. The new event is now named DRAFT_SAVE

Thus this replaces #2413

This change is useful for plugins that may want to implement their own toolbar (and thus hide the
default toolbar), but still would like to let the locktimer set the draft status.
Plugins may want to add further fields to be present when saving drafts.
Plugins may want to execute some js functionality that should be timed to
the saved draft/refreshed lock.

If a plugin does another init() to attach the dw_locktimer to its own editor,
then the default callback would be added a second time, causing unexpected
and undesired behavior.

This includes the changes from the following commits:
6ef45cc
6ca947f
0fff419
87bed8b
@micgro42
Copy link
Collaborator Author

micgro42 commented Jun 8, 2018

Re|: that failed Scrutinizer inspection:
This error suppression is intended as check against race conditions between two two processes. We should either define an accepted way to handle this case or turn that inspection off.

micgro42 added a commit to cosmocode/dokuwiki-plugin-prosemirror that referenced this pull request Jun 8, 2018
The pull request at DokuWiki has been replaced with a rewrite which
implements things a bit cleaner.
inc/Draft.php Outdated
protected $id;
protected $client;

public function __construct($ID, $client)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing doc block ;-)

Copy link
Collaborator

@splitbrain splitbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@splitbrain splitbrain merged commit 69a81ab into master Jun 14, 2018
@splitbrain splitbrain deleted the betterDraftHandling branch June 14, 2018 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants