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

Add image upload via drag'n'drop #2264

Merged
merged 5 commits into from
Mar 31, 2022
Merged

Add image upload via drag'n'drop #2264

merged 5 commits into from
Mar 31, 2022

Conversation

julien-nc
Copy link
Member

This includes those changes:

  • add image upload via drag'n'drop from file explorers
  • remove image upload by link (because it triggers a network request on the server side which potentially exposes stuff that shouldn't be, the feature is not essential)
  • move image insertion and upload methods from MenuBar to EditorWrapper
  • allow multiple files selection in upload file input

We imitate what's done style-wise in Files when dragging stuff over: set background color to --color-primary-light.

@julien-nc
Copy link
Member Author

/compile amend

@julien-nc julien-nc force-pushed the enh/image-drag-n-drop branch 3 times, most recently from 331a2e4 to 69eb7ce Compare March 30, 2022 08:31
@julien-nc
Copy link
Member Author

/compile amend

@@ -99,6 +108,18 @@ import { Step } from 'prosemirror-transform'

const EDITOR_PUSH_DEBOUNCE = 200

const imageMimes = [
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const imageMimes = [
const IMAGE_MIMES = [

@@ -179,6 +200,8 @@ export default {
readOnly: true,
forceRecreate: false,
menubarLoaded: false,
nbUploadingImages: 0,
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nbUploadingImages: 0,
uploadingImagesCount: 0,

@ya-d ya-d mentioned this pull request Mar 30, 2022
@julien-nc julien-nc force-pushed the enh/image-drag-n-drop branch from d190de5 to b5df672 Compare March 30, 2022 11:18
Julien Veyssier added 2 commits March 30, 2022 13:20
remove image upload by link
move 'image insertion from files' from MenuBar to EditorWrapper
allow uploading multiple files

Signed-off-by: Julien Veyssier <[email protected]>
@julien-nc julien-nc force-pushed the enh/image-drag-n-drop branch from b5df672 to 2942e04 Compare March 30, 2022 11:20
@julien-nc julien-nc requested a review from vinicius73 March 30, 2022 11:21
@julien-nc
Copy link
Member Author

/compile amend

@julien-nc julien-nc force-pushed the enh/image-drag-n-drop branch from 7ff67b6 to 6f619c0 Compare March 31, 2022 09:19
@@ -45,7 +50,10 @@
:is-public="isPublic"
:autohide="autohide"
:loaded.sync="menubarLoaded"
@show-help="showHelp">
:uploading-image="uploadingImages"
Copy link
Member

Choose a reason for hiding this comment

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

For consistency, the uploadingImage property in MenuBar should maybe be named uploadingImages as well?

@julien-nc
Copy link
Member Author

/compile amend

@julien-nc julien-nc force-pushed the enh/image-drag-n-drop branch from 38be106 to c38fb17 Compare March 31, 2022 10:34
@julien-nc
Copy link
Member Author

/compile amend

Signed-off-by: Julien Veyssier <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
@julien-nc julien-nc merged commit 0db660b into master Mar 31, 2022
@delete-merged-branch delete-merged-branch bot deleted the enh/image-drag-n-drop branch March 31, 2022 12:23
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.

3 participants