Bug 1039383

Summary: RFE: Copy to clipboard button for image template xml
Product: [Community] PressGang CCMS Reporter: mmurray
Component: Web-UIAssignee: Matthew Casperson <mcaspers>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.3CC: cbredesen, lnewson, mcaspers
Target Milestone: ---   
Target Release: 1.4   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-23 23:44:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1053331    
Attachments:
Description Flags
Example of copy to clipboard button in GitHub
none
Quick copy image templates none

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.