Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Importing assets via drag'n'drop into the asset tree #78

Open
elisee opened this issue Jan 22, 2016 · 1 comment
Open

Importing assets via drag'n'drop into the asset tree #78

elisee opened this issue Jan 22, 2016 · 1 comment

Comments

@elisee
Copy link
Contributor

elisee commented Jan 22, 2016

Plugins should use SupClient.registerPlugin in some agreed-upon bundle (public/bundles/import.js?) to declare accepted media types or extensions and expose import methods.

In client/src/project/index.ts, we can load up the import.js bundles for each plugin (similar to how we load documentation.js bundles)

Then, in onTreeViewDrop, we should look through event.dataTransfer.files for media type or extensions matches. If there are multiple matches, open a dialog to ask the user to choose what to do.

Finally, call the exposed import methods which will use ProjectClient to edit the project, and see assets be magically imported! :O

See also superpowers/superpowers-game#30

@elisee
Copy link
Contributor Author

elisee commented Feb 22, 2016

Gave this some more thought. We can't have imports happen directly in project/index.html because that would involve loading all kinds of heavy files directly (THREE.js, etc.). And we probably want to be able to configure various things when importing anyway. For instance, we could have a file that is imported as multiple assets and you might want to only enable some of them?

I guess project/index.js should load a simple bundle for each plugin that will do a quick check of whether the files can be imported with it (based on extensions mostly) and report one or more "import offers" back. Then we should have an import tab that loads an iframe for each import offer that has been selected by the user and does the actual work? Something like that...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant