Copy Article URL

Request new functionality here
XianPalin
Bear Rating Trainee
Bear Rating Trainee
Posts: 21
Joined: 16 May 2013, 23:10

Copy Article URL

Postby XianPalin » 04 Jun 2013, 00:56

Instead of / in addition to "Display Article URL", can we have a "Copy URL"? Rather than opening a window with the article URL displayed, which the user is going to copy, it seems quicker to just put it on their clipboard for them.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Copy Article URL

Postby fox » 04 Jun 2013, 09:24

This is precisely like that because you can't copy stuff to clipboard arbitrarily using javascript.

User avatar
id242
Bear Rating Trainee
Bear Rating Trainee
Posts: 16
Joined: 25 Mar 2013, 14:04
Location: Los Angeles, CA
Contact:

Re: Copy Article URL

Postby id242 » 05 Jun 2013, 06:34

But something like can be done:

The JavaScript...

Code: Select all

<script language="javascript" type="text/javascript">
function ClipBoard()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
}
</script>


The Text To Be Copied...

Code: Select all

<SPAN ID="copytext" STYLE="height:150;width:162;background-color:pink">
This text will be copied onto the clipboard when you click the button below. Try it!
</SPAN>

<TEXTAREA ID="holdtext" STYLE="display:none;"></TEXTAREA>
<BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON>


Source: http://www.htmlgoodies.com/beyond/javas ... Copied.htm

But yeah, "you can't copy stuff to clipboard arbitrarily using javascript" is absolutely true. One must first click.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Copy Article URL

Postby fox » 05 Jun 2013, 09:11

Thanks, that's an interesting hack. I wonder if that could be added to the dojo context menu item. Personally I think that prompt method is good enough though.


Return to “Feature requests”

Who is online

Users browsing this forum: No registered users and 2 guests