NJACKWinterOfCode / JS-OS

An Unified Operating System on the web
3 stars 3 forks source link

Add a feature to open a text file #44

Closed ankushbhardwxj closed 4 years ago

ankushbhardwxj commented 4 years ago

We need to enhance the file explorer and integrate the code editor to it. So that, whenever a file is clicked, it opens up the code editor with the current code / text in it.

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN I'm gonna try this out 👍

RAJAGOPALAN-GANGADHARAN commented 4 years ago

Ah yes, Lets put our fs to test!

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN I got everything set here. Need a lil help. Where is the logic for launching a new window. I saw a handlers.js file which launches apps when clicked on the applauncher. Can we use that same code in explorer ? Or do I need to write something up from scratch

RAJAGOPALAN-GANGADHARAN commented 4 years ago

If my memory serves me right you can launch an app with eventDispatcher and the name of the app that is going to be launched. as far as opening a file maybe send the text file's name as a prop to the component while launching(or which u seem will be the best fit with the model). Then we can fetch the contents of the file from the db and display it.

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN I'm so stuck. I am able to fetch the contents and file name. Also I am able to launch the CodeEditor. But we cannot pass the content as prop. Because the eventdispatcher launches the original version of Editor which is empty when DOM loads.