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

Copy to clipboard #283

Merged
merged 7 commits into from
Jul 16, 2019
Merged

Conversation

tancnle
Copy link
Contributor

@tancnle tancnle commented Jul 3, 2019

Description

A working proof-of-concept for 'Copy to clipboard' functionality in index and matrix page.
I was tossing around whether to go with third party libraries like

For our use cases, I decided to start with this simple gist and wired the markup a-la-carte. I am open up to more discussion on whether this is a sensible approach.

Demo

copy-to-clipboard

This closes #211

@bethesque
Copy link
Member

This looks good! Can you see if you can fix whatever code climate is complaining about?

@tancnle
Copy link
Contributor Author

tancnle commented Jul 16, 2019

Tested on

  • Chrome 75.0.3770.142
  • Firefox 68.0
  • Safari 12.1.1

@tancnle tancnle changed the title [WIP] Copy to clipboard Copy to clipboard Jul 16, 2019
@bethesque
Copy link
Member

Love the gif! What did you use to make it?

@bethesque bethesque merged commit c10a6f2 into pact-foundation:master Jul 16, 2019
@bethesque
Copy link
Member

Many thanks @tancnle!

@tancnle tancnle deleted the copy-to-clipboard branch July 17, 2019 04:08
@tancnle
Copy link
Contributor Author

tancnle commented Jul 17, 2019

@bethesque I'd just learnt to do it as part of this PR :)

  1. Screen record and clipping with Quicktime
  2. Convert to gif using ffmpeg
brew install ffmpeg

ffmpeg -i copy-to-clipboard.mov copy-to-clipboard.gif

@bethesque
Copy link
Member

@tancnle reckon you can fix the cell resize that happens when the sha is fully taking up the column and the icon appears?

hover-move-graph

@bethesque
Copy link
Member

PS. Super fun making the gif!

@tancnle
Copy link
Contributor Author

tancnle commented Aug 9, 2019

@bethesque Yes certainly can

@tancnle
Copy link
Contributor Author

tancnle commented Aug 9, 2019

This is getting a little bit trickier than I thought. There are few options:

  1. Always show clipboard icon
  2. Fix table size (with table-layout: fixed) and set version columns to a fixed percentage (ie. 25%) and use word-wrap: break-word magic (see gif)

clipboard-layout-tweak-2

Any preferences @bethesque?

@bethesque
Copy link
Member

Could you always include the icon, but style it as hidden until the mouseover event happens?

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

Successfully merging this pull request may close these issues.

Add "copy to clipboard" buttons that appear when hovering over versions and tags on index and matrix
2 participants