Make collabora save and exit actions more intuitive #12#16
Draft
oanalavinia wants to merge 1 commit intoxwikisas:mainfrom
Draft
Make collabora save and exit actions more intuitive #12#16oanalavinia wants to merge 1 commit intoxwikisas:mainfrom
oanalavinia wants to merge 1 commit intoxwikisas:mainfrom
Conversation
* add 2 new buttons in the editor menu: save and exit + close editor and use the postMesage API to handle the events
Contributor
Author
|
There are some things that should be considered for this UI.
|
mflorea
reviewed
Jul 8, 2023
| $escapetool.xml($fileDoc.displayTitle) | ||
| </a> | ||
| #macro (unsavedChangesModal) | ||
| <div class="modal fade" id="editUnsavedChanges" tabindex="-1" role="dialog" aria-hidden="true" |
Contributor
There was a problem hiding this comment.
Suggested change
| <div class="modal fade" id="editUnsavedChanges" tabindex="-1" role="dialog" aria-hidden="true" | |
| <div class="modal fade" id="collaboraUnsavedChanges" tabindex="-1" role="dialog" aria-hidden="true" |
| <input type="submit" class="btn btn-danger" | ||
| value="$escapetool.xml($services.localization.render('collabora.editor.unsaved.submit'))"> | ||
| <input type="button" class="btn btn-default" data-dismiss="modal" | ||
| value="$escapetool.xml($services.localization.render('collabora.editor.unsaved.close'))"> |
Contributor
There was a problem hiding this comment.
Does it make sense to also have the option to save before closing the editor?
| <a href="${xwiki.getURL('Main.WebHome')}"><img src="$xwiki.getSkinFile('logo.svg')"></a> | ||
| </div> | ||
| <div> | ||
| <strong>$currentAction</strong> |
Contributor
There was a problem hiding this comment.
I know you do the escaping below, when setting the value, but I find it more clear to perform the escaping in the place where the value is used (because the escaping depends on the context where the value is used). specially since you use the value only once, here.
| 'SendTime': Date.now(), | ||
| 'Values': { | ||
| 'id': 'saveAndExitEditor', | ||
| 'imgurl': window.location.origin + $("#collaboraConfig").data('saveExitIcon'), |
Contributor
There was a problem hiding this comment.
Suggested change
| 'imgurl': window.location.origin + $("#collaboraConfig").data('saveExitIcon'), | |
| 'imgurl': new URL($("#collaboraConfig").data('saveExitIcon'), window.location.origin), |
| 'SendTime': Date.now(), | ||
| 'Values': { | ||
| 'id': 'closeEditor', | ||
| 'imgurl': window.location.origin + $("#collaboraConfig").data('closeIcon'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

save and exit+close editorand use the postMesage API to handle the eventsThe buttons in the menu:

The popup displayed when the user wants to close the editor and there are unsaved changes:
