NJACKWinterOfCode / JS-OS

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

load up editor #45

Closed ankushbhardwxj closed 4 years ago

ankushbhardwxj commented 4 years ago

fixes #44 Currently we are in a position that when we click the File, it fires up the code editor. However we have a problem with the event dispatcher which will be fixed in a new issue & PR.

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN Look at the event dispatcher function in this commit. I tried a separate condition for editor. When we run the function, we can transfer the contents or code of a respective file to the RunningTasks constructor, as this.code = code. But when I tried to pass it as a prop to the appInstaller it didnt work. This is because appInstaller was loaded at the beginning of loading the DOM. So there's basically no way our Editor can get the prop because it was already loaded up a long time ago.

ankushbhardwxj commented 4 years ago

One solution can be to modify the existing eventdispatcher. Otherwise we need to create a separate launcher inside the handleClick function in explorer.js. When a file is clicked, we should be able to launch the icon on the taskbar , and then the window , and then the code editor inside of window. I would prefer the second one because I feel it would be cleaner.

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN Which one would you like ? If so, please try to write the syntax in the comments.

ankushbhardwxj commented 4 years ago

Also, if you want to do it in a later issue, We can merge this PR for now 👍 The current behaviour is as follows: JS-OS-GoogleChrome2020-01-0423-2

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN Bro, it just works flawlessly. Ready to be merged 👍 👍 Also if a file is empty nothing gets passed as prop, which is cool. JS-OS-GoogleChrome2020-01-0513-0

ankushbhardwxj commented 4 years ago

@RAJAGOPALAN-GANGADHARAN made the required changes. Now it works perfectly.