MediaWiki/ExtensionV4
- Jmol as a standalone application.
- J(S)mol as a web applet or HTML5 object.
- compatibility with JavaScript frameworks or libraries.
- J(S)mol embedded in wikis or blogs.
- Borrowed JSmol, or running JSmol without your own server.
- Running Jmol using Java Web Start.
- JSmol in a Jupyter notebook.
- Jmol in an Android tablet.
- Troubleshooting.
Jmol MediaWiki Extension (version 4)
- Please check the version you have installed in your wiki (browse to Special pages, then Version). Documentation for former versions of the Extension may be found in MediaWiki/ExtensionV3.
There are 3 ways to use Jmol / JSmol models in a wiki that implements this extension:
- Simple calls: Inserting a link that will open a Jmol model in a popup window, with no custom rendering, no scripting.
- Popup calls: Inserting a link or a button that will open a Jmol model in a popup window, allowing scripts and custom rendering.
- In-page models: Inserting a Jmol object within the page content, allowing scripts and custom rendering. Alternatively, inserting controls that will act on the Jmol object (links, buttons, radio buttons, menus... that will apply scripts to the model).
Contents
Simple calls
These tags in a MediaWiki page generate a hyperlink that will open a new window (pop-up) filled with a Jmol object (by default the JSmol HTML5 modality). The Jmol object will fit the window, which is resizable. No custom rendering styles or scripting can be applied to the model.
The model data may come from one of 3 sources:
- a file that has been previously uploaded to the wiki;
- a file retrieved from the RCSB PDB database server (macromolecules);
- a file retrieved from the CACTUS NIH server.
All 3 tags need to include the file name/ID of the model and optionally they may include a text
parameter that will be used as the visible text making the link.
Tag <jmolFile>
This tag produces a link that opens a popup Jmol object and loads the model from a file that has been previously uploaded to the wiki. The model is displayed in the default rendering (ball and stick, CPK color, white background).
The file must be uploaded to the wiki as if it were an image, using the "Upload file" link in the "Toolbox" panel on the left. Its location is hence [[File:MyMolecule.mol]], but only the name, MyMolecule.mol, must be inserted inside the <jmolFile> tag.
Examples:
<jmolFile>Chair.cml</jmolFile>
is rendered as Chair.cml which, when clicked, will open a Jmol object with the model read from File:Chair.cml.
<jmolFile text="Show ethanol">Ethanol.xyz</jmolFile>
is rendered as Show ethanol which, when clicked, will open a Jmol object with the model read from File:Ethanol.xyz.
Tag <jmolPdb>
This tag produces a link that opens a Jmol object and loads the model from the RCSB PDB database server. The model is displayed in the default rendering (ball and stick, CPK color, white background).
Only the 4-character ID of the molecule in the PDB must be inserted inside the <jmolPdb> tag.
Examples:
<jmolPdb>2CDS</jmolPdb>
is rendered as 2CDS which, when clicked, will open a Jmol object with the model retrieved from the PDB server.
<jmolPdb text="structure of lysozyme">2CDS</jmolPdb>
is rendered as structure of lysozyme which, when clicked, will open a Jmol object with the model read from the PDB server.
Tag <jmolSmiles>
This tag produces a link that opens a Jmol object and loads the model from the CACTUS NIH server, constructed from a SMILES string, CAS number, InChI key or chemical name. The model is displayed in the default rendering (ball and stick, CPK color, white background).
The name or key of the molecule must be inserted inside the <jmolSmiles> tag.
Examples:
<jmolSmiles>CCCNC</jmolSmiles>
is rendered as CCCNC which, when clicked, will open a Jmol object with the propylmethylamine structure (of which CCCNC is the SMILES string) retrieved from the CACTUS server.
<jmolSmiles text="something for your headache">aspirin</jmolSmiles>
is rendered as something for your headache which, when clicked, will open a Jmol object with the structure of aspirin read from the CACTUS server.
Popup calls
These tags use the same method as the <jmolApplet> tag described in the following section; description and examples here are minimal; go to next section for further details.
These tags in a MediaWiki page generate a hyperlink or a button that will open a new window (pop-up) filled with a Jmol object (by default the JSmol HTML5 modality). The Jmol object will fit the window, which is resizable.
The tags must be enclosed in an enveloping <jmol> tag, which may also enclose additional tags to achieve custom rendering styles and any scripting.
The model data may come from one of several sources, same as for <jmolApplet> below.
Tag <jmolAppletButton>
This will add a button that opens a popup Jmol object; make sure to include the <text> tag in it. For example:
<jmol> <jmolAppletButton> <uploadedFileContents>file uploaded in the wiki containing the molecular data</uploadedFileContents> <text>text displayed in the button</text> </jmolAppletButton> </jmol>
Tag <jmolAppletLink>
This will insert a link that opens a popup Jmol object. You need to include the <text> tag in it. For example:
<jmol> <jmolAppletLink> <uploadedFileContents>file uploaded in the wiki containing the molecular data</uploadedFileContents> <text>text displayed in the link</text> </jmolAppletLink> </jmol>