-
Notifications
You must be signed in to change notification settings - Fork 16
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
after pasting images, upload them if storageType isn't base64 #56
base: master
Are you sure you want to change the base?
Conversation
9fefae7
to
4f8d188
Compare
adjusted the tests: if storageType is local it will check if an image element appears.
|
The old tests check if the uploaded SVG was included in the HTML, immediately after setting the HTML. In case Etherpad would remove the image due to some error it's possible that the test returns true even if the image gets removed in the end. To make this a little less likely, prior to checking the HTML, let's wait for an ACCEPT message from the server.
4f8d188
to
9dd7b62
Compare
9dd7b62
to
0daf766
Compare
This is ready now. @ilmartyrk @rhansen @JohnMcLear Can you give it a try? Any feedback welcome |
I think I need to look at the regex again. It seems to work, but it throws some lint error |
0daf766
to
5c5c4b4
Compare
Now slightly less readable without named groups in the regex, but it should work |
Instead of observing the clipboard, we first put the data URI into the pad text, so it is uploaded by contentCollector. When Etherpad starts using the Clipboard API we should use it too.
5c5c4b4
to
af2b141
Compare
|
@webzwo0i Thanks a lot for your contribution. We have not missed your PR but we have time issues on Citizen OS side and haven't had opportunity to look at it. We will snooze this to unknown times from our side. |
This is a fix for #55
After pasting images, in case storageType is not base64, the image is immediately removed from DOM and uploaded via POST.
~~The upload code is copied from toolbar.js - should this be moved into an separate function to avoid duplication?
Any feedback welcome. I mark this as draft, because I didn't explicitly test the format of
lineAttributes.img
, so the new code is executed even when the toolbar button is used (that would be wrong). However, everything seems to work which is kind of unexpected.~~