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

Attachment as link improvment #1460

Closed
JtheBAB opened this issue May 23, 2019 · 6 comments
Closed

Attachment as link improvment #1460

JtheBAB opened this issue May 23, 2019 · 6 comments

Comments

@JtheBAB
Copy link

JtheBAB commented May 23, 2019

Describe the feature you'd like
Please add a possibility to create a link within a page that open directly the attachment.

Describe the benefits this feature would bring to BookStack users
Adding attachments to the page is create. But sometimes you want to give more context to it. With a link in the text the user can get the correct attachment during they read the text.

Additional context
It is already possible to to this:
suggestion

Perhaps it is possible that it creates during this process also the link?

@ssddanbrown
Copy link
Member

Thanks for the suggestion @JtheBAB.

Somewhat related to #591.

@XVilka
Copy link
Contributor

XVilka commented Sep 23, 2019

Is there any progress towards solution?

@andre-lx
Copy link

andre-lx commented Nov 6, 2019

In my opinion, I think that can be better to add a new icon (next to the pencil) to download the file and when you click the link (currently this downloads the file) , creates a link in the text like:

[file name.pdf](/attachments/10)

@gurpal2000
Copy link

gurpal2000 commented May 16, 2020

That drag drop doesn't work for me. It gives a "no entry/exit" sign. A major blocker to use Bookstack if this or a selector isn't supported. A copy of a link is not good enough as the ip/domain can change. Nor should one have to go into source put a relative link... Please let me know

@ziermmar
Copy link

ziermmar commented Jun 4, 2020

+1 from me for this feature. Is there some progress already? Will this be implemented?

@ssddanbrown ssddanbrown added this to the v0.30.0 milestone Jul 12, 2020
ssddanbrown added a commit that referenced this issue Sep 13, 2020
Cannot get working in chrome reliably due to conflicting handling of
events and drag+drop API. Getting attachment drop working breaks other
parts of TinyMCE.
Implementing current work as should still work for MD editor and within
FireFox.

Related to #1460
@ssddanbrown
Copy link
Member

Spent many hours on this for v0.30.0.

Initially tried to implement a drag+drop solution but I could not get a consistent result in all browsers due to the WYSIWYG editor's (TinyMCE) manual, complex handling of various drag+drop/mouse events.

Therefore I've added a button to the attachment cards which inserts a link, with the correct attachment name, into the editor (Both WYSIWYG and Markdown Editors) when clicked.

I've left some of the drag+drop code in still which should still allow you to drag the attachment "card" into your content when using (Any editor in Firefox) or (Markdown editor in any browser).

This will be part of the v0.30 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants