Bug 1039383 - RFE: Copy to clipboard button for image template xml
Summary: RFE: Copy to clipboard button for image template xml
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: Web-UI
Version: 1.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.4
Assignee: Matthew Casperson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1053331
TreeView+ depends on / blocked
 
Reported: 2013-12-09 01:32 UTC by mmurray
Modified: 2014-08-04 22:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-02-23 23:44:00 UTC


Attachments (Terms of Use)
Example of copy to clipboard button in GitHub (2.48 KB, image/png)
2013-12-09 01:32 UTC, mmurray
no flags Details
Quick copy image templates (174.00 KB, image/png)
2014-01-15 03:29 UTC, Matthew Casperson
no flags Details

Description mmurray 2013-12-09 01:32:48 UTC
Created attachment 834174 [details]
Example of copy to clipboard button in GitHub

Description of problem:

On pages where details are displayed about individual images stored in PressGang there are currently DocBook image templates for image, bare images and inline image. I use these templates regularly when adding images to topics.

Instead of having to click in the template box and press Ctrl+A to select the template xml and then Ctrl+X to copy, it would be useful if there was a copy to clipboard button.

An example of such a button is on GitHub for copying repo URLs [1]. Image attached.

[1] https://github.com/jbosstools/jbosstools-documentation

Comment 1 Matthew Casperson 2014-01-12 20:58:08 UTC
Copying to the clipboard is notoriously tricky (if not impossible) with plan Javascript. Most solutions rely on a Flash solution like http://zeroclipboard.org/.

I've been reluctant to introduce a dependency on Flash. Maybe we just do it though.

We could also define some snippets for image XML generation.

Comment 2 Matthew Casperson 2014-01-15 03:28:22 UTC
Fixed in 201401151315 and deployed to the dev server.

We've addressed this in two ways.

First is the addition of the snippets figure, mediaobject and inlinemediaobject. Typing any one of those words and pressing tab will expand the image templates, and you can then tab through the replacable fields (like the image id).

Second, when a new image is loaded or a new image template is selected in the tab view, the template text is automatically selected so end users only need to press CTRL-C to copy it to the clipboard.

See the attached screenshot for an example.

Comment 3 Matthew Casperson 2014-01-15 03:29:23 UTC
Created attachment 850328 [details]
Quick copy image templates

Comment 4 Lee Newson 2014-01-28 00:38:33 UTC
Verified that the three snippets mentioned work and are the correct XML. Also the image view now highlights and focuses the selected template so that CTRL+C can be used (it's worth noting CTRL+X won't work, but given it's a readonly box I don't see that as an issue).

Comment 5 Lee Newson 2014-01-28 00:41:02 UTC
Additional Note:

Just adding since it's not abundantly clear, but the "copy to clipboard" functionality used by GitHub is using flash.


Note You need to log in before you can comment on or make changes to this bug.