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)
- The exported page has to be from 2010 or later as I found this process doesn't work for pages created in 2009. It seems you need the pages made with Jaime Prilusky's exportPage version 1.80 or later. This information is noted in the 'index.html' file within the main folder of the exported page folder. Search for 'exportPage' within the HTML of the page. Those generated in 2009 do not list the version of the generator.
- 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 'index.html', 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>
- 9. Scroll down a few lines to
<script type="text/javascript" src="Jmol/Jmol.js"></script>
and change that by removing 'Jmol/' to read
<script type="text/javascript" src="Jmol.js"></script>
- 10. Scroll down a few more lines to
jmolInitialize("Jmol/", window.location.protocol == "file:");
and change that by replacing 'Jmol' with a period to read
jmolInitialize(".", window.location.protocol == "file:");
- 11. Save the 'index.html' file.
- 12. Now open the 'index.html' file in your browser, preferably Firefox. Firefox is the only browser that will work on a Mac running the Lion operating system. The structure windows should be active and you should be able to click on scenes.
- Even if you did the process correctly, if your Proteopedia exported files are too old (before 2010 it seems; see note under PREPARATION), you'll get the error
jmolAppletInline not implemented
RELATEDRELATED
As it is if you put it online, it will be locked into running with the Javascript-based JSmol. If you want to run to put this up online to run only with Java-based Jmol or run it offline with Java (which is not a possibility of a modern Mac), then you would edit the 39th line in the 'Jmol.js' file from
use: "HTML5", // could be JAVA or HTML5
to read
use: "JAVA", // could be JAVA or HTML5