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
Implements clipboard feature for markdown areas. #7032
Conversation
@@ -11,6 +11,8 @@ class ProjectsController < ApplicationController | |||
layout 'navless', only: [:new, :create, :fork] | |||
before_filter :set_title, only: [:new, :create] | |||
|
|||
rescue_from CarrierWave::IntegrityError, :with => :invalid_file |
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.
Use the new Ruby 1.9 hash syntax.
interesting... |
|
||
if my_event.clipboardData and my_event.clipboardData.items | ||
i = 0 | ||
console.log my_event.clipboardData.items[0] |
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.
please remove console.log
in this PR
@randx I've updated the code :) |
Would be nice to extends to formatted text also no? |
i noticed something with the multiple files, |
@MrKeiKun See point #1 above: 😄 |
|
||
processItem = (e, item) -> | ||
console.log e.clipboardData.items.length | ||
console.log isImage(item) |
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.
remove console.log
!!!
@randx Sorry about the console logs. All of it are now deleted :) |
@erbunao thank you :) |
Implements clipboard feature for markdown areas.
After this merged I cannot copy-paste formatted text into comment form. Cmd+V just doesnt fork for both Chrome and Safari |
@randx had to revert this to re-enable copy pasting formatted text. If you can fix this please submit a new merge request. Also, please allow drag-and-drop for all file formats (non-images are attached as downloads). |
Also, you might want to remove copy-pasting due to missing browser support dropzone/dropzone#517 (comment) |
@dosire, yeah, I've also read about the HTML5 clipboard being immature, at least, for now. We submitted this PR nonetheless because we have observed that we're getting the same behavior as others (we thought that it's "okay"). |
@nmcalabroso Yeah, I can see where you were coming from. But since it broke stuff please submit the adapted version without it. |
@nmcalabroso Of course, it is awesome that you and @erbunao are working on these usability improvements. |
@dosire, all right, will update this PR soon 👍 |
@nmcalabroso Great, thanks! |
@dosire, just to clarify, what do you mean by "adapted version"? |
@nmcalabroso I think he meant the drag-and-drop feature without support for copy-pasting images (since it introduced regressions in current behavior. |
@padi That was indeed what I meant, thanks. @nmcalabroso Thanks for submitting the new PR |
Ignore URLs starting with // in Markdown links ## What does this MR do? Render `[foo](//bar/baz)` as `<a href="//bar/baz">foo</a>`. ## Why was this MR needed? `[foo](//bar/baz)` currently renders as `<a href="//bar/gitlab-org/gitlab-ce/master/baz">foo</a>` ## What are the relevant issue numbers? fixes #7032 See merge request !5677
* master: (363 commits) Added changelog item for issuable form dropdowns Add 'run tests' docs from GDK Bump gitlab_git to lazy load compare commits Add examples to repository files API (!5465) Ignore URLs starting with // (!5677) Add failing test for #7032 Update timeago to shorter representation Add missing DOWNTIME constant to the AddTimestampsToMembersAgain migration Added guide about migrations and downtime Update CHANGELOG for 8.10.4 Add a data migration to fix some missing timestamps in the members table (again) Move abilities by subject class to a dedicated method Remove unnecessary empty line after css var Set consistency in list text height css Add description to text/plain emails Fix Rename `add_users_into_project` and `projects_ids` fix spec Underscore variable to camelCase using shared path for project import uploads and refactored gitlab remove export worker Structure the development documentation ...
This is our (w/ @nmcalabroso) attempt to extend the drag and drop feature in every markdown area (#7011). We have tested this feature in Mac OSX (Mavericks) and hoping to receive more feedbacks (with different OS) from you. Unfortunately, chrome is the only browser that supports the html5 clipboard.
Note:
Samples:
Copy-pasting to upload image in creating issue:
Output:
Copy-pasting multiple files:
Output:
Copy-pasting from web browser:
Output:
Error handling: