Friday, December 2, 2016

How to package EjsS for SLS

Student Learning Space SLS only take package in a particular form, so this is a tutorial for anyone interested to contribute their EjsS simulation into this space.

for example,

  1. package is isolated and no link out
  2. zip with index.html in the root of the zip

the following is a possible way to get any OSP JavaScript simulation into the Student Learning Space.
This post is made for educational purposes and it not intended for non cyberwellness behavior.

  1. Open up EjsS by double click on the EjsConsole.jar 
  2. Selected the simulation and package as an app
  3. navigate to export folder of the workspace and expand the file say 
  4. copy the simulation gravity04_Simulation.xhtml file into the root of the folder 
  5. rename the exisitng index.html into indexold.html 

  6. change the name of the simulation to index.html
  7. the prepare the new index.html file use any web editor to open it 
  8.  do a find for 
    1. ../
  9. remove these characters 
  10. the lines should look like this now
    1. <link rel="stylesheet" type="text/css" href="css/ejss.css" /> 
    2. <script src="js/common_script.js" type="text/javascript"></script> 
    3. <script src="js/textresizedetector.js" type="text/javascript"></script>
    4.  <script src="js/ejsS.v1.min.js" type="text/javascript"></script>
  11. double click on index.html to test it work properly 

  12. selected all the file by keyboard a CONTROL + A 
  13. right click and compress in a zip file of any name 
  14. upload to SLS and it should work, enjoy!