extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Added HTML Inputs Extension

Open samuellouf opened this issue 1 year ago • 13 comments

HTML Extension

Hi there! This extension allows you to insert HTML inputs on the canvas. Here are the blocks. This extension's blocks You can :

  • create/delete inputs and select menus.
  • set/get their values, dimentions, position.
  • Hide/show them...

Here's the extension. Here's the exemple's .sb3 / compiled html.

Enjoy!

samuellouf avatar Jan 23 '24 09:01 samuellouf

Isn't the position functionality already in the iframe extension?

mybearworld avatar Jan 27 '24 15:01 mybearworld

Isn't the position functionality already in the iframe extension?

Yes, it is. But, let me explain a little bit : In the iframe extension, the Scratch VM will create a div over the canvas to add the iframe. But, when you insert HTML, it will just create a data URL for the code and set it as the iframe's source. Example: <h1>It works!</h1> will become <iframe src="data:text/html;,%3Ch1%3EIt%20works!%3C%2Fh1%3E"></iframe> You can't get an input's value and change the elements' coordinates individually. With my extension, you can. In my extension, the Scratch VM will create a div over the canvas to add the element. It will do this for every single element.

samuellouf avatar Jan 27 '24 19:01 samuellouf

Isn't the position functionality already in the iframe extension?

Yes, it is. But, let me explain a little bit : In the iframe extension, the Scratch VM will create a div over the canvas to add the iframe. But, when you insert HTML, it will just create a data URL for the code and set it as the iframe's source. Example: <h1>It works!</h1> will become <iframe src="data:text/html;,%3Ch1%3EIt%20works!%3C%2Fh1%3E"></iframe> You can't get an input's value and change the elements' coordinates individually. With my extension, you can. In my extension, the Scratch VM will create a div over the canvas to add the element. It will do this for every single element.

seems interesting, should probably add a simplified version of what you said to the description of the extension so people get the difference

nmsderp avatar Mar 14 '24 21:03 nmsderp

Yea, considering what this extension does, maybe it should be called something like "HTML Inputs" or something.

CST1229 avatar Mar 14 '24 21:03 CST1229

Yea, considering what this extension does, maybe it should be called something like "HTML Inputs" or something.

Done!

samuellouf avatar Mar 18 '24 14:03 samuellouf

Closed for being stale.

yuri-kiss avatar Feb 05 '25 00:02 yuri-kiss

I'm going to work on it! (Yep, I know, I'm 11 months late)

samuellouf avatar Feb 19 '25 09:02 samuellouf

okay, I will reopen the PR

yuri-kiss avatar Feb 19 '25 16:02 yuri-kiss

!format

yuri-kiss avatar Feb 19 '25 16:02 yuri-kiss

The formatting bot didn't find any formatting issues. It currently only checks the extensions folder. To format all files, the pull request's author can manually run the 'Format pull request' workflow from the 'Actions' tab on the fork.

github-actions[bot] avatar Feb 19 '25 16:02 github-actions[bot]

Forgot to add Scratch.translate

samuellouf avatar Feb 20 '25 14:02 samuellouf

Okay! My pull request is validated!

samuellouf avatar Feb 20 '25 14:02 samuellouf

Finally done!

samuellouf avatar Feb 21 '25 09:02 samuellouf