Difference between revisions of "MediaWiki/ExtensionV5"
AngelHerraez (talk | contribs) (updates to Jmol MW Extension v5) |
AngelHerraez (talk | contribs) (→Third-level subtags) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 27: | Line 27: | ||
=== Full-featured tag === | === Full-featured tag === | ||
+ | ==== First level tag ==== | ||
The <code>jmol</code> tag encloses different subtags that offer more flexibility in how and when the model will be displayed, | The <code>jmol</code> tag encloses different subtags that offer more flexibility in how and when the model will be displayed, | ||
as well as its rendering or scripting. | as well as its rendering or scripting. | ||
− | Second-level subtags: | + | ==== Second-level subtags that insert a JSmol panel (either inline or in a popup) ==== |
− | * | + | * Inline JSmol panel: |
− | * <code> | + | ** <code>jmolApplet</code> inserts the JSmol panel in the page as soon as it is loaded. See [[MediaWiki/Tags for In-page Models]] for details. |
− | * <code>jmolAppletInlineButton</code> | + | ** <code>jmolAppletInlineButton</code> |
− | * <code>jmolAppletInlineLink</code> both will, upon user action, insert into the page a JSmol panel displaying a structure. See [[MediaWiki/Tags for Pop-in Models]] for details. | + | ** <code>jmolAppletInlineLink</code> both will, upon user action, insert into the page a JSmol panel displaying a structure. See [[MediaWiki/Tags for Pop-in Models]] for details. |
− | * <code> | + | * Pop-up JSmol panel: |
− | + | ** <code>jmolAppletButton</code> | |
+ | ** <code>jmolAppletLink</code> both will, upon user action, open a small window (pop-up) with a JSmol panel displaying the structure. See [[MediaWiki/Tags for Pop-up Models]] for details. | ||
+ | |||
+ | ==== Second-level subtags that insert controls to act on one JSmol panel ==== | ||
+ | See [[MediaWiki/Tags for Controls]] for details and examples. | ||
+ | * <code>jmolButton</code> | ||
* <code>jmolLink</code> | * <code>jmolLink</code> | ||
* <code>jmolCheckbox</code> | * <code>jmolCheckbox</code> | ||
Line 42: | Line 48: | ||
* <code>jmolRadioGroup</code> | * <code>jmolRadioGroup</code> | ||
− | Third-level subtags: | + | ==== Third-level subtags ==== |
− | * <code> | + | These are relevant for <code>jmolApplet</code>, and some of them also for some other 2nd-level subtags: |
− | * <code>script</code> | + | * <code>text</code> (displayed in the page or in the UI control) |
− | * <code>uploadedFileContents</code> | + | * <code>script</code> (commands for the molecule display in JSmol) |
+ | * <code>uploadedFileContents</code> (model to be loaded) | ||
* <code>urlContents</code> | * <code>urlContents</code> | ||
* <code>wikiPageContents</code> | * <code>wikiPageContents</code> | ||
* <code>inlineContents</code> | * <code>inlineContents</code> | ||
− | * <code> | + | * <code>title</code> (either tooltip for the UI control or text to be displayed above the JSmol panel) |
− | * <code> | + | * <code>caption</code> (text to be displayed below the JSmol panel) |
− | * <code> | + | * <code>color</code> (background color of JSmol panel) |
− | * <code> | + | * <code>size</code> (dimensions of JSmol panel) |
− | * <code> | + | * <code>controls</code> (display of optional buttons below the JSmol panel; value: any combination of spin | quality | labels | popup) |
− | * <code> | + | * <code>frame</code> (border around the JSmol panel) |
− | * <code> | + | * <code>image</code> (cover image to be displayed; replaced with the JSmol panel upon click) |
− | * <code>pspeed</code> | + | * <code>pspeed</code> (performance: higher speed vs. higher quality, relevant for mobile platforms) |
− | * <code>name</code> applies to <code>jmolApplet</code>, | + | * <code>name</code> (applies to <code>jmolApplet</code>, needed when several JSmol panels are presemt in a page) |
+ | These are more specific and relevant just for some 2nd-level subtags: | ||
* <code>target</code> applies to <code>jmolButton</code>, <code>jmolLink</code>, <code>jmolCheckbox</code>, <code>jmolMenu</code>, <code>jmolRadioGroup</code> | * <code>target</code> applies to <code>jmolButton</code>, <code>jmolLink</code>, <code>jmolCheckbox</code>, <code>jmolMenu</code>, <code>jmolRadioGroup</code> | ||
* <code>scriptWhenChecked</code> applies only to <code>jmolCheckbox</code> | * <code>scriptWhenChecked</code> applies only to <code>jmolCheckbox</code> | ||
* <code>scriptWhenUnchecked</code> applies only to <code>jmolCheckbox</code> | * <code>scriptWhenUnchecked</code> applies only to <code>jmolCheckbox</code> | ||
− | * <code>checked</code> applies only to <code>jmolRadioGroup</code> | + | * <code>checked</code> applies only to <code>jmolMenu</code> and <code>jmolRadioGroup</code> |
* <code>item</code> applies only to <code>jmolMenu</code> and <code>jmolRadioGroup</code> | * <code>item</code> applies only to <code>jmolMenu</code> and <code>jmolRadioGroup</code> | ||
* <code>vertical</code> applies only to <code>jmolRadioGroup</code> | * <code>vertical</code> applies only to <code>jmolRadioGroup</code> | ||
* <code>menuheight</code> applies only to <code>jmolMenu</code> | * <code>menuheight</code> applies only to <code>jmolMenu</code> | ||
+ | == How to install the Jmol Extension == | ||
+ | Please see [[MediaWiki/Installation]] | ||
+ | |||
+ | = Former versions = | ||
+ | |||
+ | For documentation on former versions of the Extension, see [[MediaWiki/ExtensionV3]] and [[MediaWiki/ExtensionV4]]. | ||
− | = Test Pages = | + | == Test Pages == |
# A few [[MediaWiki/Basic Example|basic examples]] of the {{tag|jmolFile}}, {{tag|jmolPdb}} and {{tag|jmolSmiles}} tags. | # A few [[MediaWiki/Basic Example|basic examples]] of the {{tag|jmolFile}}, {{tag|jmolPdb}} and {{tag|jmolSmiles}} tags. | ||
Line 80: | Line 94: | ||
# [[Load SMILES]] via script -- Includes test of signed applet and {{tag|jmolMenu}} | # [[Load SMILES]] via script -- Includes test of signed applet and {{tag|jmolMenu}} | ||
# [[User:Bduke#Tests_of_Jmol_incorporated_into_a_MediaWiki_wiki | Test page]] (Brian's) | # [[User:Bduke#Tests_of_Jmol_incorporated_into_a_MediaWiki_wiki | Test page]] (Brian's) | ||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 21:01, 12 May 2024
- 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.
Contents
Jmol (JSmol) Extension for MediaWiki, version 5
For general information on this Extension and particularly about how to install and set it up, visit the MediaWiki page.
This version of the Extension has been developed and tested with MediaWiki 1.32.
It will use by default JSmol objects in the HTML5 modality, but configuration may be adjusted to allow the Java modality (signed applet) or the WebGL modality (note that JSmol has limited functionality with the latter). All mentions of either Jmol or JSmol in this documentation are synonyms. Note also that the use of "applet" in names and references is maintained for legacy reasons but Java is not involved any more (unless forced by the user and allowed by the wiki administrator).
- 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 and MediaWiki/ExtensionV4.
How to use the Jmol Extension
This applies to version 5 of the Extension
Simple tags
There are 4 tags that will render a link in the page that, when clicked by the user, will open a small window (pop-up) with a JSmol panel that displays a structure. No custom rendering or scripting on the structure is possible.
jmolFile
jmolMol
jmolSmiles
jmolPdb
See MediaWiki/Simple_Tags for details and demonstration with examples.
Full-featured tag
First level tag
The jmol
tag encloses different subtags that offer more flexibility in how and when the model will be displayed,
as well as its rendering or scripting.
Second-level subtags that insert a JSmol panel (either inline or in a popup)
- Inline JSmol panel:
jmolApplet
inserts the JSmol panel in the page as soon as it is loaded. See MediaWiki/Tags for In-page Models for details.jmolAppletInlineButton
jmolAppletInlineLink
both will, upon user action, insert into the page a JSmol panel displaying a structure. See MediaWiki/Tags for Pop-in Models for details.
- Pop-up JSmol panel:
jmolAppletButton
jmolAppletLink
both will, upon user action, open a small window (pop-up) with a JSmol panel displaying the structure. See MediaWiki/Tags for Pop-up Models for details.
Second-level subtags that insert controls to act on one JSmol panel
See MediaWiki/Tags for Controls for details and examples.
jmolButton
jmolLink
jmolCheckbox
jmolMenu
jmolRadioGroup
Third-level subtags
These are relevant for jmolApplet
, and some of them also for some other 2nd-level subtags:
text
(displayed in the page or in the UI control)script
(commands for the molecule display in JSmol)uploadedFileContents
(model to be loaded)urlContents
wikiPageContents
inlineContents
title
(either tooltip for the UI control or text to be displayed above the JSmol panel)caption
(text to be displayed below the JSmol panel)color
(background color of JSmol panel)size
(dimensions of JSmol panel)controls
(display of optional buttons below the JSmol panel; value: any combination of spin | quality | labels | popup)frame
(border around the JSmol panel)image
(cover image to be displayed; replaced with the JSmol panel upon click)pspeed
(performance: higher speed vs. higher quality, relevant for mobile platforms)name
(applies tojmolApplet
, needed when several JSmol panels are presemt in a page)
These are more specific and relevant just for some 2nd-level subtags:
target
applies tojmolButton
,jmolLink
,jmolCheckbox
,jmolMenu
,jmolRadioGroup
scriptWhenChecked
applies only tojmolCheckbox
scriptWhenUnchecked
applies only tojmolCheckbox
checked
applies only tojmolMenu
andjmolRadioGroup
item
applies only tojmolMenu
andjmolRadioGroup
vertical
applies only tojmolRadioGroup
menuheight
applies only tojmolMenu
How to install the Jmol Extension
Please see MediaWiki/Installation
Former versions
For documentation on former versions of the Extension, see MediaWiki/ExtensionV3 and MediaWiki/ExtensionV4.
Test Pages
- A few basic examples of the <jmolFile>, <jmolPdb> and <jmolSmiles> tags.
- A demo page for the <jmol> tag
- Uploaded XYZ File -- includes test of <jmolCheckbox>, <jmolLink>, <jmolButton>, and <jmolMenu>
- Uploaded MDL Molfile
- Uploaded CML File
- Uploaded PDB File opening in a pop-up -- tests
jmolAppletLink
- Inlined MDL Molfile
- Inlined PDB File
- Inlined CML File
- Load SMILES via script -- Includes test of signed applet and <jmolMenu>
- Test page (Brian's)