netizenorg / netnet.studio

netnet.studio is a hypermedia higherEd cyberspace for fully realizing the Web’s creative potential.
https://netnet.studio
GNU General Public License v3.0
29 stars 8 forks source link

Upload JSON feature #213

Closed Cthomp7 closed 1 year ago

Cthomp7 commented 1 year ago

This is what I created for the upload JSON button for the Demo/Example Maker. (additionally linted two other lines in the file)

If there are better ways to structure things (it's a bit long), I would love to make this as efficient and condensed as I can.

I want to add a "do you want to upload this file?" convo message before loading the JSON content and need to fix a toc issue, but wanted to start the PR to discuss revisions of what I have already created before moving forward. :)

Cthomp7 commented 1 year ago

Hey @nbriz! I have fixed the new code according to the comments above.

To confirm:

I was receiving standard JS errors for the const fileUploader = new nn.FileUploader({... , so I added the Object.create(fileUploader) to fix this. I am not sure if this is the proper way to do this, so that's why I wanted to point this out and get your feedback. Thanks!

Cthomp7 commented 1 year ago

@nbriz, I have made a new commit with the changes requested above.

Let me know if there are any other issues!