User:Wayne Decatur/Converting Exported Proteopedia Pages from Jmol to JSmol
Java security has made working offline with Proteopedia pages more difficult. Macs running the current operating system have no options for even running Proteopedia pages at present because Jmol is based on Java. This is to provide a work around by converting the exported pages to run on a Javascript version of Jmol, called JSmol.
Note: at the moment the option to export pages from Proteopedia has been disabled because of the Java issues. Wayne Decatur 21:47, 10 September 2013 (IST)
PREPARINGPREPARING
Need:
- The exported page from Proteopedia you want to convert.
- Currently, the ability to export pages is disabled in the Proteopedia toolbox and so you cannot produce this if you don't already have a set. Wayne Decatur 22:03, 10 September 2013 (IST)
- Duplicate the folder containing the exported pages and add '_JSmol' to the end to distinguish it. If you skip this step you may destroy your exported pages and they may not work again.
- The current version of Jmol that includes JSmol.
- You can find that here.
- These directions were done with the current version available there and thus mileage may vary. Wayne Decatur 21:56, 10 September 2013 (IST)
- Download and unzip and then unzip the 'jsmol.zip' file within that.
CONVERSIONCONVERSION
- Open the folder with the exported Proteopedia page and delete the 'Jmol' folder.
- Open the 'java' folder in the folder with the exported Proteopedia page. All that should be in there is 'MageJava.jar'. Then open the 'java' folder in the 'jsmol' folder in the Jmol files you have and copy (hold down 'ctrl' as you drag on a Windows machine or the 'option' button on a Mac machine) all the contents from this 'java' folder to the one into the 'java' folder in the folder with the exported Proteopedia page. This should add a lot of files along with 'MageJava.jar' now.
- Go back up to the 'jsmol' folder in your downloaded Jmol set of files and go back up to the main folder in your exported Proteopedia page set of files. Copy the entire 'j2s' folder in the Jmol file set into the main folder of the exported Proteopedia page
- Open the 'jsmol' in the Jmol files you have and copy 'Jmol2.js' into the main folder of the exported Proteopedia page.
- Rename the 'Jmol2.js' file to 'Jmol.js'
- Copy the 'JSmol.min.js' file from the Jmol set of files into the the main folder of the exported Proteopedia page.
- Open in a text editor 'index.html' from the main folder of the exported Proteopedia page.
- Before the javascript calls at the top, which is after the line
<link rel="stylesheet" type="text/css" href="Files/main.css" />
in my case, paste
<script type="text/javascript" src="JSmol.min.js"></script>
- Scroll down a few lines to
<script type="text/javascript" src="Jmol/Jmol.js"></script>
and change that to be
<script type="text/javascript" src="Jmol.js"></script>
- Scroll down a few more lines to
jmolInitialize("Jmol/", window.location.protocol == "file:"); and change that to be <pre> #Scroll down a few more lines to jmolInitialize(".", window.location.protocol == "file:");