I need a plugin that duplicates a chunk of content by clicking an icon in the corner of the element. The plugin (and icon) should to attach itself dynamically to any element with a class of 'copyable' (i.e. so no markup other than the class is required in the source), and simply copy the contents of that element to immediately after its closing tag. It would need to be dynamic enough that any copied item, or copyable elements added by other plugins, can itself be copied immediately.
For example if I start with a layout like this, where the clickable button is the green 'C' in the corner:
Clicking the button would result in this:
In markup terms, 'before' could look like this:
<div class="copyable"> Content in here </div>
and the 'after' view would simply be:
<div class="copyable"> Content in here </div> <div class="copyable"> Content in here </div>
Another need: a copyable element may contain other copyable elements, and they should just be copied too if the parent element is copied.
Does anyone know of a plugin that will do this? Alternatively, is anyone up for developing one, paid?
Here's a working prototype in
Here's a working prototype in plain JS. It works quite nicely, though it's not usable on table cells or rows. Now all I need to do is figure out how (or find someone who can!) to do this inside CKEditor...