Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Show Direct Link - Copy to Clipboard
Last Post 06/14/2013 2:03 PM by Peter Donker. 1 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
CSEA Webmaster
New Member
New Member
Posts:7


--
06/14/2013 6:37 AM
After a couple hours of work, I've managed to integrate the ZeroClipBoard jQuery library into the Show Direct Link function of DMX. This will allow your users to click a button and copy the URL to the clipboard.

(Since this is my first post here, I'm not sure how this is going to display.)

Here's what you'll need:

1) The zClip library and Flash file: http://www.steamdev.com/zclip/

2) The ability to edit the appropriate DMX javascript file on your web server (I used AjaxTwoPanel.js) adding the zClip code to the "openURLWindow" function.

I spent a lot of time styling my page, which I won't reproduce here. All you need is two paragraph tags.

The first one holds the document URL:

[p id='description']a.document.write(b)[/p]

The second one holds the anchor tag that references the URL:

[p][a href='#' id='copy-description']Click to copy URL[/a][/p]

Put your jQuery script blocks at the end, after the content loads.

[script]http://ajax.googleapis.co....js[/script]

[script]/PATH_TO_JS_FILE/jquery.zclip.min.js[/script]

And finally, the code that does the work.

[script]$(document).ready(function(){$('a#copy-description').zclip({path:'/PATH_TO_SWF_FILE/ZeroClipboard.swf',copy:$('p#description').text()});});[/script]

That's it. It worked like a charm for me in Firefox 21, Chrome 27 and IE9. Good luck!
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
06/14/2013 2:03 PM
Thanks! As the dependency of DMX moves up in the future I'll be integrating more jQuery bits into the module.

Peter
You are not authorized to post a reply.