Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

[Confirmed] Flash 10 problem: No more Copy Code to Clipboard


  • Please log in to reply
45 replies to this topic
polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
JSLover suggested the same method in the beginning but I wasn't too keen on the idea as it requires additional clicking and/or key presses. ZeroClipboard breaks Ctrl+C but I suppose it is the best option here. I read an interesting blog post (two part) on planet Mozilla about this, the writer concluded that there is no real solution for standards compliant browsers.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

I've noticed on some other phpBB forums (such as the VirtualBox forums) a "select all" link on each code box, which seems to work well. It appears to be implemented with just javascript; the function can be found in the phpBB reference: selectCode.

Since action of selecting the code is the biggest source of manual labor when copying to the clipboard, I think select-all would be worthwhile. If anyone would like to work on this (perhaps using Lexikos' links above), I'd be interested in applying it to the forum.

Thanks for the links.

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

JSLover suggested the same method in the beginning but I wasn't too keen on the idea as it requires additional clicking and/or key presses.

Funny - it always annoyed me that the Copy button brought up a "the code has been copied" message box, which requires an additional click or key press...

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012

it always annoyed me that the Copy button brought up a "the code has been copied" message box, which requires an additional click or key press...

You can disable it in your browser settings, set the right cookie option or have a userscript similar to function alert(){} (untested) but this is offtopic. The focus is getting the text onto the clipboard, if you didn't know.

autohotkey.com/net Site Manager

 

Contact me by email (polyethene at autohotkey.net) or message tidbit


shajul
  • Members
  • 571 posts
  • Last active: Aug 01 2015 03:45 PM
  • Joined: 15 Sep 2006
any update on this? would be happy if select could be implemented..

BUMP

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
It seems a solution is available here <!-- m -->http://code.google.c.../zeroclipboard/<!-- m -->

The Zero Clipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface. The "Zero" signifies that the library is invisible and the user interface is left entirely up to you.

This library is fully compatible with Flash Player 10, which requires that the clipboard copy operation be initiated by a user click event inside the Flash movie. This is achieved by automatically floating the invisible movie on top of a DOM element of your choice. Standard mouse events are even propagated out to your DOM element, so you can still have rollover and mouse down effects.



derRaphael
  • Members
  • 872 posts
  • Last active: Mar 19 2013 04:42 PM
  • Joined: 23 Nov 2007
i just coded a quick solution which actually works fine with iron 4 and ff 3.x

havent had time to check for other browsers. a live sample can be found here (all sources included):

<!-- m -->https://ahknet.autoh.../ClipBoardCopy/<!-- m -->

greets
dR

All scripts, unless otherwise noted, are hereby released under CC-BY

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Very nice dR!.. Works with Google Chrome too!

derRaphael
  • Members
  • 872 posts
  • Last active: Mar 19 2013 04:42 PM
  • Joined: 23 Nov 2007
thx skan, i just checked msie 7 (xp sp3) and there it works, too

can this be confirmed for other versions, too?

greets
dR

All scripts, unless otherwise noted, are hereby released under CC-BY

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008
Great stuff :)

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005

checked msie 7 (xp sp3)


Works in msie 6.0.2900 (xp sp3)..

derRaphael
  • Members
  • 872 posts
  • Last active: Mar 19 2013 04:42 PM
  • Joined: 23 Nov 2007
Opera 10.10 winxp sp3 confirmed to work

Note: for all those expirienceing that the text is all in a single line (eg when pasted into notepad) it is no bug, the script works as desired. the demo htmlpage has no CRLF but only LF and this is what gets copied into clipboard.

All scripts, unless otherwise noted, are hereby released under CC-BY

Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006
Worked for me in FF 3.6.3 and IE8 (Win7).

Note: for all those expirienceing that the text is all in a single line (eg when pasted into notepad) it is no bug, the script works as desired.

I guess that means it doesn't work as desired in IE8, since the LF are converted to CRLF and the text is readable in Notepad. ;)

derRaphael
  • Members
  • 872 posts
  • Last active: Mar 19 2013 04:42 PM
  • Joined: 23 Nov 2007
lexikos are you sure, that this is not a sideeffect of notepad in win7 - by means did u paste into SciTe and checked the lineendings via ctrl+shift+9 ?

greets
dR

All scripts, unless otherwise noted, are hereby released under CC-BY

Gauss
  • Members
  • 203 posts
  • Last active: Jan 27 2012 12:49 PM
  • Joined: 10 Sep 2009
I just updated my flash player and copy code is no longer there, that's how I came here, there is a whole thread about it!
Is it hard to get such a simple thing to work for all version of flash player? :?