LifeViewer cutting and pasting issue

For discussion directly related to ConwayLife.com, such as requesting changes to how the forums or home page function.
Post Reply
hkoenig
Posts: 258
Joined: June 20th, 2009, 11:40 am

LifeViewer cutting and pasting issue

Post by hkoenig » February 10th, 2020, 1:00 am

I'm trying to track down a problem I'm having between LifeViewer and an app I'm working on.

On a webpage, I try to copy a pattern that's being displayed by using "ctrl-c". I then get that string and attempt to paste it into by app. There's nothing but an empty string. This is an iOS app, so I've looked at various encodings (UTF8, UTF16, ASCII, ancient MacOS), and none seem to matter.

If I paste the string into a TextEdit document, it appears just fine. But pasting into an XCode (Apple's development IDE), or a Terminal window, I see the same behavior-- no string. So it's not just my ignorance of pasting strings. Somethin' ain't right, somewheres.

What is being placed in the pasteboard/clipboard? I'm using Safari on a Mac to display the string I want to copy. The strings in the "SELECT ALL / SHOW IN VIEWER" box work just fine, so I suspect it's something to do with the way JavaScript does the copy.

User avatar
rowett
Moderator
Posts: 3776
Joined: January 31st, 2013, 2:34 am
Location: UK
Contact:

Re: LifeViewer cutting and pasting issue

Post by rowett » February 10th, 2020, 5:59 am

hkoenig wrote:
February 10th, 2020, 1:00 am
If I paste the string into a TextEdit document, it appears just fine.
This would indicate that LifeViewer is successfully copying to the clipboard.
hkoenig wrote:
February 10th, 2020, 1:00 am
What is being placed in the pasteboard/clipboard?
LifeViewer creates the RLE in a <textarea> element which it then asks the browser to "select all" and then "copy".
If the pattern is very large then it creates multiple <textarea> elements and you'll see a progress bar (bottom left) as it copies and then be promted to "press Enter to complete copy".

Post Reply