-
Notifications
You must be signed in to change notification settings - Fork 2
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
Make collabora save and exit actions more intuitive #12 #16
base: main
Are you sure you want to change the base?
Conversation
* add 2 new buttons in the editor menu: save and exit + close editor and use the postMesage API to handle the events
There are some things that should be considered for this UI.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
$escapetool.xml($fileDoc.displayTitle) | ||
</a> | ||
#macro (unsavedChangesModal) | ||
<div class="modal fade" id="editUnsavedChanges" tabindex="-1" role="dialog" aria-hidden="true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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'))"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'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'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above.
save and exit
+close editor
and 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: