Difference between revisions of "Jmol JavaScript Object"
AngelHerraez (talk | contribs) (link to Jmol.js documentation page) |
AngelHerraez (talk | contribs) (first tips - which files are needed) |
||
Line 2: | Line 2: | ||
==Installation== | ==Installation== | ||
+ | |||
+ | These files must be accesible to the html page (note that [[Troubleshooting/Applet#Java_security_errors|Java scurity policy]] imposes limitations on the folder location of files): | ||
+ | |||
+ | * {{file|JmolApplet0*.jar}} or {{file|JmolAppletSigned0*.jar}} | ||
+ | : (That is a set of files, where the * stands for several suffixes. You may need to read about [[Jmol_Applet#Unsigned_vs._Signed_Applet_.26_Data_Access|signed vs. unsigned applet]].) | ||
+ | * {{file|JmolCore.js}} | ||
+ | * {{file|JmolApplet.js}} | ||
+ | * {{file|JmolApi.js}} | ||
+ | * {{file|JmolControls.js}} | ||
+ | |||
==Initialization== | ==Initialization== | ||
===Basic=== | ===Basic=== | ||
+ | |||
+ | The html page must reference (usually with a <code>script</code> tag in the <code>head</code> section) the javascript libraries: | ||
+ | * {{file|JmolCore.js}} essential | ||
+ | * {{file|JmolApplet.js}} essential, must go after JmolCore | ||
+ | * {{file|JmolApi.js}} essential, must go after JmolCore | ||
+ | * {{file|JmolControls.js}} optional, must go after JmolCore; only needed if you will insert user interface controls like buttons, links, menus, etc. | ||
+ | |||
+ | ===Using the ChemDoodle alternative=== | ||
+ | The html page must reference these additional javascript libraries: | ||
+ | * {{file|jQuery.min.js}} required; unrelated to Jmol and not included in Jmol distribution. The [http://jquery.com/ jQuery JavaScript Library]. | ||
+ | * {{file|gl-matrix-min.js}} required; not included in Jmol distribution. [https://github.com/toji/gl-matrix Javascript Matrix and Vector library for High Performance WebGL apps]. | ||
+ | * {{file|mousewheel.js}} required; not included in Jmol distribution. [https://github.com/brandonaaron/jquery-mousewheel/ jQuery Mouse Wheel Plugin]. | ||
+ | * {{file|ChemDoodleWeb.js}} required; from [http://web.chemdoodle.com/ ChemDoodle Web Components]; must go after the above three. | ||
+ | * {{file|JmolCD.js}} required; must go after JmolApplet and all those above. | ||
+ | |||
+ | ===Using the GLmol alternative=== | ||
+ | The html page must reference these additional javascript libraries: | ||
+ | * {{file|jQuery.min.js}} required; unrelated to Jmol and not included in Jmol distribution. The [http://jquery.com/ jQuery JavaScript Library]. | ||
+ | * {{file|Three49custom.js}} required; not included in Jmol distribution; available with GLmol, below. | ||
+ | * {{file|GLmol.js}} required; from [http://webglmol.sourceforge.jp/index-en.html GLmol - Molecular Viewer on WebGL/Javascript]; must go after the above two. | ||
+ | * {{file|JmolGlmol.js}} required; must go after JmolApplet and all those above. | ||
===Initialization parameters=== | ===Initialization parameters=== | ||
==API== | ==API== |
Revision as of 18:15, 22 July 2012
Jmol Javascript Object is a set of javascript functions and utilities refactored and reorganized into a single javascript object. It supersedes the former Jmol.js javascript library as it allows for a cleaner, more efficient way to interact with the applet from javascript, and abstracts the view of a molecular model so that the applet could be seamlessly replaced by an image, or a third party visualization method depending on client's browser resources.
Contents
Installation
These files must be accesible to the html page (note that Java scurity policy imposes limitations on the folder location of files):
- (That is a set of files, where the * stands for several suffixes. You may need to read about signed vs. unsigned applet.)
Initialization
Basic
The html page must reference (usually with a script
tag in the head
section) the javascript libraries:
- JmolCore.js essential
- JmolApplet.js essential, must go after JmolCore
- JmolApi.js essential, must go after JmolCore
- JmolControls.js optional, must go after JmolCore; only needed if you will insert user interface controls like buttons, links, menus, etc.
Using the ChemDoodle alternative
The html page must reference these additional javascript libraries:
- jQuery.min.js required; unrelated to Jmol and not included in Jmol distribution. The jQuery JavaScript Library.
- gl-matrix-min.js required; not included in Jmol distribution. Javascript Matrix and Vector library for High Performance WebGL apps.
- mousewheel.js required; not included in Jmol distribution. jQuery Mouse Wheel Plugin.
- ChemDoodleWeb.js required; from ChemDoodle Web Components; must go after the above three.
- JmolCD.js required; must go after JmolApplet and all those above.
Using the GLmol alternative
The html page must reference these additional javascript libraries:
- jQuery.min.js required; unrelated to Jmol and not included in Jmol distribution. The jQuery JavaScript Library.
- Three49custom.js required; not included in Jmol distribution; available with GLmol, below.
- GLmol.js required; from GLmol - Molecular Viewer on WebGL/Javascript; must go after the above two.
- JmolGlmol.js required; must go after JmolApplet and all those above.
Initialization parameters
API
Contributors
AngelHerraez, Hansonr, Hansonrstolaf, Cudo29, Ceroni, Ppillot