Why won't my very simple stack work in HTML5?

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 44
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Mon Feb 05, 2024 6:46 am

SWEdeAndy wrote:
Sun Feb 04, 2024 9:25 pm

Accessing the clipboard data should be simpler, one would assume, but that seems to be a tricky business as well. Theoretically, using navigator.clipboard.readText should do it, but there are user permission issues to overcome first. I have spent some time searching for solutions in various web/javascript forums, but I have not yet had any success in getting a LC stack to do it. I'll look into it again another day, as I too would like to find a method to do this.
Yes, I suspected this was likely. I am not that familiar with how browsers operate but I know OS's and end users must give permissions. How do "cookies" work in general? They are given user permission in most cases and I wonder if the parameters of a cookie would allow them to store user input and/or simple interactive data? This may be a dumb question, but I could imagine so many possibilities if some rudimentary data could be locally associated with an app, even if highly restrictive.
“You do what you do out of your own private passion for the thing itself”
A Dillard (source: https://educheer.com/essays/annie-dillard-s-handed-my-own-life/)

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 44
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Mon Feb 05, 2024 7:03 am

By the way, things are significantly more interesting since adopting LC 10 dp (as suggested by SWEdeAndy). The function that would not respond now works from the script stack when called by my btn, and "answer.." works as well.
My latest iteration is usable:
https://wildcard.on-rev.com/my/24-02.04 ... yDate.html
Why, though, do "answer" dialogs include a prelude, such as "wildcard.on-rev.com says..."
This is unrequested and ugly, if nothing else!
Attachments
Screen Shot 2024-02-04 at 10.55.54 PM.png
“You do what you do out of your own private passion for the thing itself”
A Dillard (source: https://educheer.com/essays/annie-dillard-s-handed-my-own-life/)

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Sat Aug 16, 2008 9:48 am
Contact:

Re: Why won't my very simple stack work in HTML5?

Post by SWEdeAndy » Fri Feb 09, 2024 8:26 pm

mbossiere wrote:
Mon Feb 05, 2024 6:46 am
I could imagine so many possibilities if some rudimentary data could be locally associated with an app, even if highly restrictive.
And here we can strike a happier note: Local storage will be your friend! There is a thorough blog post on this by LC staff:
https://livecode.com/storing-user-data-on-the-web/

"The LocalStorage object is one of the most widely used objects in web programming as it provides a simple solution for storing key-value pairs locally on a user’s computer with no expiration date.These values can be strings, numbers, booleans, or even objects. Here, stored data will remain available even when you close the browser or tab."
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 44
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Sun Feb 11, 2024 5:59 am

SWEdeAndy wrote:
Fri Feb 09, 2024 8:26 pm
mbossiere wrote:
Mon Feb 05, 2024 6:46 am
I could imagine so many possibilities if some rudimentary data could be locally associated with an app, even if highly restrictive.
And here we can strike a happier note: Local storage will be your friend! There is a thorough blog post on this by LC staff:
https://livecode.com/storing-user-data-on-the-web/

"The LocalStorage object is one of the most widely used objects in web programming as it provides a simple solution for storing key-value pairs locally on a user’s computer with no expiration date.These values can be strings, numbers, booleans, or even objects. Here, stored data will remain available even when you close the browser or tab."
A happier note indeed! This is a revelation for me. Very excited to explore the LocalStorage object further - thanks for this valuable link Andreas!
“You do what you do out of your own private passion for the thing itself”
A Dillard (source: https://educheer.com/essays/annie-dillard-s-handed-my-own-life/)

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Sat Aug 16, 2008 9:48 am
Contact:

Re: Why won't my very simple stack work in HTML5?

Post by SWEdeAndy » Sun Mar 17, 2024 11:13 pm

mbossiere wrote:
Thu Feb 01, 2024 4:45 pm
SWEdeAndy, I'd also be very curious if you have any similar workarounds concerning file I/O (writing to and from local files on a Mac/Linux/Windows etc) -- and/or the ability to accept clipboard data from a user (incoming). File I/O - even just text - would be magic! Marc
You'll be happy to see that I finally found how to crack the pasting nut - see my just released WebDeployHelper tool beta over here: https://forums.livecode.com/viewtopic.php?f=120&t=38989

I'd be interested to get your feedback on it, if you have time to test it.
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 44
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Mon Mar 18, 2024 7:29 am

[/quote]

You'll be happy to see that I finally found how to crack the pasting nut - see my just released WebDeployHelper tool beta over here: https://forums.livecode.com/viewtopic.php?f=120&t=38989

I'd be interested to get your feedback on it, if you have time to test it.
[/quote]

Thanks Andreas
I very much look forward to exploring WebDeployHelper when I find a moment. It's late here so all I have done so far is open the tool and seen a very enticing interface. I am excited... hopefully by the end of this busy week I can find a few quiet hours and report back.
Marc
“You do what you do out of your own private passion for the thing itself”
A Dillard (source: https://educheer.com/essays/annie-dillard-s-handed-my-own-life/)

mbossiere
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 44
Joined: Wed Aug 01, 2007 2:15 am

Re: Why won't my very simple stack work in HTML5?

Post by mbossiere » Mon Mar 18, 2024 6:06 pm

SWEdeAndy wrote:
Sun Mar 17, 2024 11:13 pm
mbossiere wrote:
Thu Feb 01, 2024 4:45 pm
SWEdeAndy, I'd also be very curious if you have any similar workarounds concerning file I/O (writing to and from local files on a Mac/Linux/Windows etc) -- and/or the ability to accept clipboard data from a user (incoming). File I/O - even just text - would be magic! Marc
You'll be happy to see that I finally found how to crack the pasting nut - see my just released WebDeployHelper tool beta over here: https://forums.livecode.com/viewtopic.php?f=120&t=38989

I'd be interested to get your feedback on it, if you have time to test it.
https://wildcard.on-rev.com/my/myDate/index.html

I played with WebDeployHelper a bit before work today.. absolutely wonderful! Here's what I did with my MyDate tool. Much more elegant.
Later I will post questions I'm sure. Bravo Andreas!
Did not yet explore paste/copy functionality but look forward to it.
Marc
“You do what you do out of your own private passion for the thing itself”
A Dillard (source: https://educheer.com/essays/annie-dillard-s-handed-my-own-life/)

SWEdeAndy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 296
Joined: Sat Aug 16, 2008 9:48 am
Contact:

Re: Why won't my very simple stack work in HTML5?

Post by SWEdeAndy » Mon Mar 18, 2024 8:35 pm

mbossiere wrote:
Mon Mar 18, 2024 6:06 pm
https://wildcard.on-rev.com/my/myDate/index.html

I played with WebDeployHelper a bit before work today.. absolutely wonderful! Here's what I did with my MyDate tool. Much more elegant.
Later I will post questions I'm sure. Bravo Andreas!
Did not yet explore paste/copy functionality but look forward to it.
Marc
Thanks Marc, I'm glad you like it and find use for it. :D

The copy functionality is no different than the one you already got, I think, i.e. only script-based without ctrl/command + c support. Still working on cracking that one.

The paste functionality is much better, and fully supports ctrl/command + v or using the Paste menu choice in the browser's edit menu. (If you download my updated stack, where I fixed a bug when pasting in Windows.)

One hint: Now that you use the index.html file, you can give people a shorter url to your web app:
https://wildcard.on-rev.com/my/myDate is sufficient.
Andreas Bergendal
Independent app and system developer
Free LC dev tools: https://github.com/wheninspace
(WIS_WebDeployHelper, WIS_ScriptDependencies, WIS_BrowserAnimation)
WhenInSpace: https://wheninspace.com

Post Reply

Return to “HTML5”