Page MenuHomePhabricator

[AG] Story: Copying attribution with one click (plain text or html)
Closed, ResolvedPublic2 Estimated Story Points

Description

As a user I can to copy the attribution with one click as plain text into my clipboard so I can use it how I wish to.
As a user I can to copy the licence credit with one click in html format so I can add it to my blog.

*the text of the attribution is read-only
*make button background quickly flash three times between colours when copying

mockups

39.png (800×1 px, 146 KB)

39_doc.png (800×1 px, 164 KB)

Event Timeline

KasiaWMDE raised the priority of this task from to Medium.
KasiaWMDE updated the task description. (Show Details)
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
KasiaWMDE renamed this task from [AG] Copying attribution with one click in different formats (plan, html) to [AG] Story: Copying attribution with one click in different formats (plan, html).Jul 16 2015, 1:25 PM
KasiaWMDE set Security to None.
KasiaWMDE moved this task from Incoming to Backlog on the Tool-Attribution-Generator board.
KasiaWMDE renamed this task from [AG] Story: Copying attribution with one click in different formats (plan, html) to [AG] Story: Copying attribution with one click (plain text).Aug 19 2015, 2:39 PM
KasiaWMDE updated the task description. (Show Details)
KasiaWMDE edited a custom field.
KasiaWMDE renamed this task from [AG] Story: Copying attribution with one click (plain text) to [AG] Story: Copying attribution with one click (plain text or html).Oct 20 2015, 4:51 PM
KasiaWMDE updated the task description. (Show Details)
Addshore moved this task from Review to Done on the TCB-Team-Sprint-2015-11-11 board.
Addshore subscribed.

@Jakob_WMDE @Addshore
I just tested it in Safari and Firefox on a Mac: the copy button flashed but didn't copy anything. Once I wanted to paste it into a doc (both using the usual cmd+v and "paste"), it didn't work.
On my windows laptop it copied in Chrome and Firefox but without the links and with large spaces before and after the attribution.

I just tested it in Safari and Firefox: the copy button flashed but didn't copy anything. Once I wanted to paste it into a doc (both using ctrl+v and "paste"), it didn't work.

Please read about clipboard.js' browser support.

Reopening until issues are fixed.

Yes, as @Ricordisamoa pointed out the currently supported browsers are Chrome 42+, Firefox 41+, IE 9+ and Opera 29+. Safari is not supported at all. We could either redo this using a different tool that supports Safari (I'm not sure there is one that doesn't use some Flash hacks) or at least fail with an error in case the text could not be copied.

@Jakob_WMDE best would probably be to not show the copy-button at all if it is not supported. Think that is doable, right?

the "large spaces problem" should be fixed, though.

@Tobi_WMDE_SW I just looked into this briefly and for some reason it's not that easy to check if it's supported. The maintainer of the clipboard.js library explains it here: https://github.com/zenorocha/clipboard.js/issues/12
The easiest way would still be to just show an error. I agree though that not showing it at all would be better...

Ok, as just discussed in the meeting: Let's

  • invest an our looking for an alternative library
  • if there is no easy solution, let's go for "Show a hint to the user in case it's not possible to copy and give the advice to use CTRL+C. Additionally mark the text in the field already.

Actually the Selection and execCommand APIs are so simple they can be used without any library.

PR with zeroclipboard instead of clipboard.js https://github.com/wmde/Lizenzverweisgenerator/pull/159

Flash? 😧

Tobi_WMDE_SW raised the priority of this task from Medium to High.Dec 9 2015, 2:51 PM