|
|
(9 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| {{Running_Jmol_Sections}} | | {{Running_Jmol_Sections}} |
| | | |
− | = Jmol MediaWiki Extension (version 5) = | + | = 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. | | For general information on this Extension and particularly about how to install and set it up, visit the [[MediaWiki]] page. |
Line 11: |
Line 11: |
| :''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]].'' | | :''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]].'' |
| | | |
− | There are 4 ways to use JSmol models in a wiki that implements this extension:
| |
− | # '''In-page models''': Inserting a JSmol object within the page content, allowing scripts and custom rendering. Additionally, inserting controls that will act on the JSmol object (links, buttons, radio buttons, menus... that will apply scripts to the model).
| |
− | # '''Pop-in calls''': Inserting a link that, when clicked, will insert a JSmol object inline below the link, allowing scripts and custom rendering.
| |
− | # '''Pop-up calls''': Inserting a link or a button that will open a JSmol model in a popup window, allowing scripts and custom rendering.
| |
− | # '''Simple calls''': Inserting a link that will open a JSmol model in a popup window, with no custom rendering, no scripting.
| |
| | | |
| | | |
− | __TOC__
| + | == How to use the Jmol Extension == |
| + | ''This applies to version 5 of the Extension'' |
| | | |
− | == In-page models == | + | === 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. |
| + | * <code>jmolFile</code> |
| + | * <code>jmolMol</code> |
| + | * <code>jmolSmiles</code> |
| + | * <code>jmolPdb</code> |
| | | |
− | All the following tags must be contained inside a {{Tag|jmol}}, {{Tag|/jmol}} pair.
| + | See [[MediaWiki/Simple_Tags]] for details and demonstration with examples. |
− | :''The use of the {{Tag|jmol}} tag (and hence, of all its sub-tags) may be disabled by the wiki administrator.''
| |
| | | |
− | === Tag {{Tag|jmolApplet}} === | + | === 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, |
| + | as well as its rendering or scripting. |
| | | |
− | This tag in a MediaWiki page inserts a JSmol object. It may be complemented with the insertion of controls that will apply some scripting on the model (see next section).
| + | ==== Second-level subtags that insert a JSmol panel (either inline or in a popup) ==== |
| + | * Inline JSmol panel: |
| + | ** <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>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. |
| + | * 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. |
| | | |
− | The tag and its complements must be enclosed in an enveloping {{Tag|jmol}} tag.
| + | ==== Second-level subtags that insert controls to act on one JSmol panel ==== |
− | All these tags and sub-tags must be opened (<code><keyword></code>) and closed (<code></keyword></code>) and in between contain the information.
| + | See [[MediaWiki/Tags for Controls]] for details and examples. |
| + | * <code>jmolButton</code> |
| + | * <code>jmolLink</code> |
| + | * <code>jmolCheckbox</code> |
| + | * <code>jmolMenu</code> |
| + | * <code>jmolRadioGroup</code> |
| | | |
− | To insert a JSmol object into a MediaWiki page, start with the following:
| + | ==== Third-level subtags ==== |
− | {{Tag|jmol}} | + | These are relevant for <code>jmolApplet</code>, and some of them also for some other 2nd-level subtags: |
− | {{Tag|jmolApplet}}
| + | * <code>text</code> (displayed in the page or in the UI control) |
− | ''...(additional information using sub-tags, read below)''
| + | * <code>script</code> (commands for the molecule display in JSmol) |
− | {{Tag|/jmolApplet}}
| + | * <code>uploadedFileContents</code> (model to be loaded) |
− | {{Tag|/jmol}} | + | * <code>urlContents</code> |
| + | * <code>wikiPageContents</code> |
| + | * <code>inlineContents</code> |
| + | * <code>title</code> (either tooltip for the UI control or text to be displayed above the JSmol panel) |
| + | * <code>caption</code> (text to be displayed below the JSmol panel) |
| + | * <code>color</code> (background color of JSmol panel) |
| + | * <code>size</code> (dimensions of JSmol panel) |
| + | * <code>controls</code> (display of optional buttons below the JSmol panel; value: any combination of spin | quality | labels | popup) |
| + | * <code>frame</code> (border around the JSmol panel) |
| + | * <code>image</code> (cover image to be displayed; replaced with the JSmol panel upon click) |
| + | * <code>pspeed</code> (performance: higher speed vs. higher quality, relevant for mobile platforms) |
| + | * <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>scriptWhenChecked</code> applies only to <code>jmolCheckbox</code> |
| + | * <code>scriptWhenUnchecked</code> applies only to <code>jmolCheckbox</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>vertical</code> applies only to <code>jmolRadioGroup</code> |
| + | * <code>menuheight</code> applies only to <code>jmolMenu</code> |
| | | |
− | ==== Sub-tags for model sources ==== | + | == How to install the Jmol Extension == |
− | The model data may come from one of several sources, and is specified in a subtag inside the {{Tag|jmolApplet}} tag:
| + | Please see [[MediaWiki/Installation]] |
| | | |
− | * A file uploaded in the wiki, containing the molecular data:
| + | = Former versions = |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolApplet}}
| |
− | {{Tag|uploadedFileContents}} name of file in the wiki {{Tag|/uploadedFileContents}}
| |
− | {{Tag|/jmolApplet}}
| |
− | {{Tag|/jmol}}
| |
− | :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 <nowiki>[[Image:MyMolecule.mol]]</nowiki>, but only the name, '''MyMolecule.mol''', must be inserted inside the <uploadedFileContents> tag.
| |
− | :<span style="color:white;font-weight:bold;background:#008F00;padding:0 1ex;">Admin:</span>
| |
− | :This possibility can be globally disabled by the Wiki administrator with the <tt>$wgJmolAuthorizeUploadedFile</tt> setting. If it is enabled, the Wiki needs to be configured to authorize the upload of molecular data files, using <tt>$wgFileExtensions</tt>. Both settings are in {{File|LocalSettings.php}}.
| |
| | | |
− | * A page of the wiki which contains as text the molecular data:
| + | For documentation on former versions of the Extension, see [[MediaWiki/ExtensionV3]] and [[MediaWiki/ExtensionV4]]. |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolApplet}}
| |
− | {{Tag|wikiPageContents}} page of the wiki containing the molecular data {{Tag|/wikiPageContents}}
| |
− | {{Tag|/jmolApplet}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | * The contents of the molecular data, written inside the tag:
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolApplet}}
| |
− | {{Tag|inlineContents}} the molecular data {{Tag|/inlineContents}}
| |
− | {{Tag|/jmolApplet}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | * An external file located anywhere in the web:
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolApplet}}
| |
− | {{Tag|urlContents}} URL of the molecular file {{Tag|/urlContents}}
| |
− | {{Tag|/jmolApplet}}
| |
− | {{Tag|/jmol}}
| |
− | :<span style="color:white;font-weight:bold;background:#008F00;padding:0 1ex;">Admin:</span>
| |
− | : This possibility can be globally disabled by the Wiki administrator with the <tt>$wgJmolAuthorizeUrl</tt> setting in {{File|LocalSettings.php}}.
| |
− | : If the file is in a server different than the wiki, you need to have <code>jsmol.php</code> properly configured in your wiki server setup<!--, or use the signed Java applet (via the {{Tag|signed}} tag, which may not be available to every user system)--> (see [[Jmol_JavaScript_Object/Info#Files_and_paths|serverURL]])
| |
− | | |
− | ==== Sub-tags for features of the JSmol object ====
| |
− | | |
− | * {{Tag|color}} Sets the background color of the JSmol object (default is white). You can specify it:
| |
− | ** With a named color belonging to the set that is recognized by Jmol (e.g. <tt>paleGoldenrod</tt>).
| |
− | ** With an hexadecimal value in the HTML format (e.g. <tt>#EEE8AA</tt>).
| |
− | ** With an hexadecimal value in the JmolScript fomat (e.g. <tt>[xEEE8AA]</tt>).
| |
− | * {{Tag|size}} Size of the applet (in pixels). Only a number should be given, meaning pixels. Only square applets are currently supported (width=height).
| |
− | * {{Tag|float}} <tt>left</tt> or <tt>right</tt>
| |
− | * {{Tag|frame}} if <tt>true</tt>, draws a frame around the JSmol object.
| |
− | * {{Tag|title}} Text displayed above the JSmol object.
| |
− | * {{Tag|titlecss}} CSS style for the title.
| |
− | * {{Tag|caption}} Text displayed below the JSmol object. Be careful with formatting or special characters; must be enabled for wikitext, i.e. you can include double square bracket links.</caption>
| |
− | * {{Tag|captioncss}} CSS style for the caption.
| |
− | * {{Tag|controls}} Inserts some utility control buttons below the JSmol object; value may be any combination of <tt> all | spin | quality | popup</tt>
| |
− | * {{Tag|script}} Jmol commands to execute right after loading the molecule.
| |
− | * {{Tag|name}} When a page includes several JSmol objects, this name allows to associate action of Jmol controls to this particular JSmol object (via a matching {{Tag|target}} in those controls).
| |
− | * {{Tag|pspeed}} Platform speed parameter for JSmol (numeric from 1 to 8)
| |
− | * {{Tag|image}} File name of an image (previously uploaded to the wiki) to be displayed instead of the model; JSmol will be loaded with the model after the user clicks on the image. An absolute URL for an external image may also be used.
| |
− | * {{Tag|animgifurl}} ''This is not yet implemented.'' URL of an animated GIF file to display before rendering the model.
| |
− | | |
− | ==== Examples ====
| |
− | | |
− | {|
| |
− | |-
| |
− | ! wikitext code:
| |
− | ! result:
| |
− | |-
| |
− | |
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolApplet}}
| |
− | {{Tag|name}}A{{Tag|/name}}
| |
− | {{Tag|title}}Cyclohexane{{Tag|/title}}
| |
− | {{Tag|caption}}Chair conformation{{Tag|/caption}}
| |
− | {{Tag|float}}right{{Tag|/float}}
| |
− | {{Tag|color}}blueTint{{Tag|/color}}
| |
− | {{Tag|size}}250{{Tag|/size}}
| |
− | {{Tag|uploadedFileContents}}Chair.xyz{{Tag|/uploadedFileContents}}
| |
− | {{Tag|pspeed}}2{{Tag|/pspeed}}
| |
− | {{Tag|controls}}spin popup{{Tag|/controls}}
| |
− | {{Tag|/jmolApplet}}
| |
− | {{Tag|/jmol}}
| |
− | Note: excess spaces inside the tags may prevent proper operation.
| |
− | |
| |
− | <jmol>
| |
− | <jmolApplet>
| |
− | <name>A</name>
| |
− | <title>Cyclohexane</title>
| |
− | <caption>Chair conformation</caption>
| |
− | <float>right</float>
| |
− | <color>blueTint</color>
| |
− | <size>250</size>
| |
− | <uploadedFileContents>Chair.xyz</uploadedFileContents>
| |
− | <pspeed>2</pspeed>
| |
− | <controls>spin popup</controls>
| |
− | </jmolApplet>
| |
− | </jmol>
| |
− | | |
− | |}
| |
− | | |
− | === Tags for controls acting on the JSmol object ===
| |
− | | |
− | Each type of control has specific options as sub-tags, but all should include a text to be displayed in the control
| |
− | and a script of Jmol commands. If the text is omitted, it will be a (shortened) copy of the script.
| |
− | | |
− | Tags for controls may be included within their own, separate {{Tag|jmol}} tag or be combined with the {{Tag|jmolApplet}} under a single {{Tag|jmol}} tag.
| |
− | | |
− | The {{Tag|target}} sub-tag is useful only when the page includes more than one JSmol object, and must match the respective {{Tag|name}} sub-tag of the {{Tag|jmolApplet}} tag.
| |
− | | |
− | ==== Tag {{Tag|jmolButton}} ====
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolButton}}
| |
− | {{Tag|script}} script to execute when the button is pressed {{Tag|/script}}
| |
− | {{Tag|text}} text displayed in the button {{Tag|/text}}
| |
− | {{Tag|name}} html name of the button {{Tag|/name}}
| |
− | {{Tag|target}} name given to the JSmol object on which the script will be applied {{Tag|/target}}
| |
− | {{Tag|/jmolButton}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | ==== Tag {{Tag|jmolLink}} ====
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolLink}}
| |
− | {{Tag|script}} script to execute when the link is clicked {{Tag|/script}}
| |
− | {{Tag|text}} text displayed in the link {{Tag|/text}}
| |
− | {{Tag|name}} html name of the <a> element {{Tag|/name}}
| |
− | {{Tag|target}} name given to the JSmol object on which the script will be applied {{Tag|/target}}
| |
− | {{Tag|/jmolLink}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | ==== Tag {{Tag|jmolCheckbox}} ====
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolCheckbox}}
| |
− | {{Tag|scriptWhenChecked}} script to execute when the checkbox is checked {{Tag|/scriptWhenChecked}}
| |
− | {{Tag|scriptWhenUnchecked}} script to execute when the checkbox is unchecked {{Tag|/scriptWhenUnchecked}}
| |
− | {{Tag|checked}} true {{Tag|/checked}}
| |
− | {{Tag|text}} text beside the checkbox {{Tag|/text}}
| |
− | {{Tag|name}} html name of the checkbox element {{Tag|/name}}
| |
− | {{Tag|target}} name given to the JSmol object on which the scripts will be applied {{Tag|/target}}
| |
− | {{Tag|/jmolCheckbox}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | {{Tag|checked}} indicates if the checkbox is initially checked when the page loads (default is false).
| |
− | | |
− | ==== Tag {{Tag|jmolRadioGroup}} ====
| |
− | Inserts a group of mutually exclusive radio buttons.
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolRadioGroup}}
| |
− | {{Tag|vertical}} true or false {{Tag|/vertical}}
| |
− | {{Tag|name}} html name of the radio group {{Tag|/name}}
| |
− | {{Tag|target}} name of the JSmol object on which the scripts will be applied {{Tag|/target}}
| |
− | {{Tag|item}}
| |
− | {{Tag|script}} script to execute when first radio button is selected {{Tag|/script}}
| |
− | {{Tag|text}} text displayed beside first radio button {{Tag|/text}}
| |
− | {{Tag|checked}} true {{Tag|/checked}}
| |
− | {{Tag|/item}}
| |
− | {{Tag|item}}
| |
− | {{Tag|script}} script to execute when second radio button is selected {{Tag|/script}}
| |
− | {{Tag|text}} text displayed beside second radio button {{Tag|/text}}
| |
− | {{Tag|/item}}
| |
− | {{Tag|/jmolRadioGroup}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | {{Tag|vertical}} indicates if the radio buttons are stacked vertically (separated by line break) or horizontally (separated by space).
| |
− | | |
− | {{Tag|checked}} indicates that particular (item) radio button is initially checked when the page loads (default is false).
| |
− | | |
− | ==== Tag {{Tag|jmolMenu}} ====
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolMenu}}
| |
− | {{Tag|menuHeight}} number {{Tag|/menuHeight}}
| |
− | {{Tag|name}} html name of the menu object {{Tag|/name}}
| |
− | {{Tag|target}} name of the JSmol object on which the scripts will be applied {{Tag|/target}}
| |
− | {{Tag|item}}
| |
− | {{Tag|script}} script to execute when first menu item is selected {{Tag|/script}}
| |
− | {{Tag|text}} text of first menu item {{Tag|/text}}
| |
− | {{Tag|checked}} true {{Tag|/checked}}
| |
− | {{Tag|/item}}
| |
− | {{Tag|item}}
| |
− | {{Tag|script}} script to execute when second menu item is selected {{Tag|/script}}
| |
− | {{Tag|text}} text of second menu item {{Tag|/text}}
| |
− | {{Tag|/item}}
| |
− | {{Tag|/jmolMenu}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | The value in {{Tag|menuHeight}} is the number of visible menu options (if 2 or more). '''1''' (the default) gives a combo-box. '''-1''' expands to make all options visible.''
| |
− | | |
− | {{Tag|checked}} indicates that particular (item) option is initially selected when the page loads (default is the first option in the menu).
| |
− | | |
− | == Pop-in calls ==
| |
− | | |
− | This tag in a MediaWiki page generates a hyperlink that, when clicked, will insert a JSmol object right below the link. The JSmol panel may later be hidden if the user clicks on its close button.
| |
− | | |
− | The tag must be enclosed in an enveloping {{Tag|jmol}}, {{Tag|/jmol}} pair.
| |
− | :''The use of the {{Tag|jmol}} tag (and hence, of all its sub-tags) may be disabled by the wiki administrator.''
| |
− | | |
− | All sub-tags of {{Tag|jmolApplet}} are allowed here (but some of them may be not applicable in this case).
| |
− | The model data may come from one of several sources, same as for the {{Tag|jmolApplet}} (described above).
| |
− | | |
− | === Tag {{Tag|jmolAppletInlineLink}} ===
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolAppletInlineLink}}
| |
− | {{Tag|uploadedFileContents}} file uploaded in the wiki containing the molecular data {{Tag|/uploadedFileContents}}
| |
− | {{Tag|text}} text displayed in the link {{Tag|/text}}
| |
− | {{Tag|size}} number of pixels for width and height of the JSmol panel {{Tag|/size}}
| |
− | {{Tag|title}} text displayed above the JSmol object {{Tag|/title}}
| |
− | {{Tag|caption}} text displayed below the JSmol object {{Tag|/caption}}
| |
− | {{Tag|/jmolAppletLink}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | | |
− | == Pop-up calls ==
| |
− | | |
− | These tags in a MediaWiki page generate a hyperlink or a button that will open a new window (pop-up) filled with a JSmol object. The JSol object will fit the window, which is resizable.
| |
− | | |
− | These tags use the same method as the {{Tag|jmolApplet}} tag described in a previous section, and can contain the same sub-tags (if applicable). Hence, description and examples here are minimal.
| |
− | | |
− | The tags must be enclosed in an enveloping {{Tag|jmol}}, {{Tag|/jmol}} pair, which may also enclose additional tags to achieve custom rendering styles and any scripting.
| |
− | :''The use of the {{Tag|jmol}} tag (and hence, of all its sub-tags) may be disabled by the wiki administrator.''
| |
− | | |
− | The model data may come from one of several sources, same as for the {{Tag|jmolApplet}} (described above).
| |
− | | |
− | === Tag {{Tag|jmolAppletButton}} ===
| |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolAppletButton}}
| |
− | {{Tag|uploadedFileContents}} file uploaded in the wiki containing the molecular data {{Tag|/uploadedFileContents}}
| |
− | {{Tag|text}} text displayed in the button {{Tag|/text}}
| |
− | {{Tag|title}} text displayed as title of the popup window {{Tag|/title}}
| |
− | {{Tag|caption}} text displayed below the model {{Tag|/caption}}
| |
− | {{Tag|x}} number of pixels {{Tag|/x}}
| |
− | {{Tag|y}} number of pixels {{Tag|/y}}
| |
− | {{Tag|/jmolAppletButton}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | {{Tag|text}} defaults to the contents of {{Tag|title}}.
| |
| | | |
− | {{Tag|title}} will be displayed in the title bar of the pop window. If not provided, defaults to "JSmol popup".
| + | == Test Pages == |
− | | |
− | {{Tag|caption}} will be displayed below the model, by the side of any control buttons. If not provided, defaults to same as title.
| |
− | | |
− | {{Tag|x}} sets the horizontal position of the popup window.
| |
− | | |
− | {{Tag|y}} sets the vertical position of the popup window.
| |
− | | |
− | === Tag {{Tag|jmolAppletLink}} === | |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolAppletLink}}
| |
− | {{Tag|uploadedFileContents}} file uploaded in the wiki containing the molecular data {{Tag|/uploadedFileContents}}
| |
− | {{Tag|text}} text displayed in the link {{Tag|/text}}
| |
− | {{Tag|title}} text displayed as title of the popup window {{Tag|/title}}
| |
− | {{Tag|caption}} text displayed below the model {{Tag|/caption}}
| |
− | {{Tag|x}} number of pixels {{Tag|/x}}
| |
− | {{Tag|y}} number of pixels {{Tag|/y}}
| |
− | {{Tag|/jmolAppletLink}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | {{Tag|text}} defaults to the contents of {{Tag|title}}.
| |
− | | |
− | {{Tag|title}} will be displayed in the title bar of the pop window. If not provided, defaults to "JSmol popup".
| |
− | | |
− | {{Tag|caption}} will be displayed below the model, by the side of any control buttons. If not provided, defaults to same as title.
| |
− | | |
− | {{Tag|x}} sets the horizontal position of the popup window.
| |
− | | |
− | {{Tag|y}} sets the vertical position of the popup window.
| |
− | | |
− | | |
− | == Simple calls ==
| |
− | | |
− | These tags in a MediaWiki page generate a hyperlink that will open a new window (pop-up) filled with a JSmol object. This will fit the window, which is resizable. No custom rendering styles or scripting can be applied to the model.
| |
− | | |
− | Note that these tags do not require a {{Tag|jmol}} tag (in contrast to the tags described in the preceding sections).
| |
− | | |
− | The model data may come from one of 4 sources:
| |
− | # a file that has been previously uploaded to the wiki;
| |
− | # a file retrieved from the RCSB [https://www.rcsb.org/ PDB] database server (macromolecules);
| |
− | # a file retrieved from the [https://cactus.nci.nih.gov/chemical/structure CACTUS] NIH server.
| |
− | # a file retrieved from either the CACTUS server or any other server (defined by the wiki administrator).
| |
− | | |
− | All 4 tags need to include just a text that specifies the model to be loaded (file name or ID).
| |
− | They may optionally include a <code>text=</code> attribute that will serve as the visible text making the link; if omitted, the model string will also be used as the link text.
| |
− | | |
− | === Tag {{Tag|jmolFile}} ===
| |
− | This tag produces a link that opens a popup JSmol 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 <nowiki>[[File:MyMolecule.mol]]</nowiki>, but only the name, MyMolecule.mol, must be inserted inside the {{Tag|jmolFile}} tag.
| |
− | | |
− | :''The use of this tag may be disabled by the wiki administrator.''
| |
− | | |
− | Examples:
| |
− | {{Tag|jmolFile}}Chair.cml{{Tag|/jmolFile}}
| |
− | is rendered as <jmolFile>Chair.cml</jmolFile> which, when clicked, will open a JSmol object with the model read from [[:File:Chair.cml|File:Chair.cml]].
| |
− | {{Tag|<nowiki>jmolFile text="Show ethanol"</nowiki>}}Ethanol.xyz{{Tag|/jmolFile}}
| |
− | is rendered as <jmolFile text="Show ethanol">Ethanol.xyz</jmolFile> which, when clicked, will open a JSmol object with the model read from [[:File:Ethanol.xyz|File:Ethanol.xyz]].
| |
− | | |
− | :<span style="color:white;font-weight:bold;background:#008F00;padding:0 1ex;">Admin:</span>
| |
− | :This possibility can be globally disabled by the Wiki administrator with the <tt>$wgJmolAuthorizeUploadedFile</tt> setting. If it is enabled, the Wiki needs to be configured to authorize the upload of molecular data files, using <tt>$wgFileExtensions</tt>. Both settings are in {{File|LocalSettings.php}}.
| |
− | :The use of this tag may be disabled by setting <tt>$wgJmolAuthorizeJmolFileTag</tt> false in {{File|LocalSettings.php}}
| |
− | | |
− | === Tag {{Tag|jmolPdb}} ===
| |
− | This tag produces a link that opens a popup JSmol object and loads the model from the [http://www.rcsb.org/pdb/ 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 {{Tag|jmolPdb}} tag.
| |
− | | |
− | :''The use of this tag may be disabled by the wiki administrator.''
| |
− | | |
− | Examples:
| |
− | {{Tag|jmolPdb}}2CDS{{Tag|/jmolPdb}}
| |
− | is rendered as <jmolPdb>2CDS</jmolPdb> which, when clicked, will open a JSmol object with the model retrieved from the PDB server.
| |
− | {{Tag|<nowiki>jmolPdb text="structure of lysozyme"</nowiki>}}2CDS{{Tag|/jmolPdb}}
| |
− | is rendered as <jmolPdb text="structure of lysozyme">2CDS</jmolPdb> which, when clicked, will open a JSmol object with the model read from the PDB server.
| |
− | | |
− | :<span style="color:white;font-weight:bold;background:#008F00;padding:0 1ex;">Admin:</span>
| |
− | :The server to be used may be changed by the wiki administrator from the default to any other that holds a copy of the PDB database (e.g., PDBe, PDBj, Proteopedia)
| |
− | :The use of this tag may be disabled by setting <tt>$wgJmolAuthorizeJmolPdbTag</tt> false in {{File|LocalSettings.php}}
| |
− | | |
− | === Tag {{Tag|jmolSmiles}} ===
| |
− | This tag produces a link that opens a popup JSmol object and loads the model from the [https://cactus.nci.nih.gov/chemical/structure 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 {{Tag|jmolSmiles}} tag.
| |
− | | |
− | :''The use of this tag may be disabled by the wiki administrator.''
| |
− | | |
− | Examples:
| |
− | {{Tag|jmolSmiles}}CCCNC{{Tag|/jmolSmiles}}
| |
− | is rendered as <jmolSmiles>CCCNC</jmolSmiles> which, when clicked, will open a JSmol object with the propylmethylamine structure (of which CCCNC is the [[:en:SMILES|SMILES string]]) retrieved from the CACTUS server.
| |
− | {{Tag|<nowiki>jmolSmiles text="something for your headache"</nowiki>}}aspirin{{Tag|/jmolSmiles}}
| |
− | is rendered as <jmolSmiles text="something for your headache">aspirin</jmolSmiles> which, when clicked, will open a JSmol object with the structure of aspirin read from the CACTUS server.
| |
− | | |
− | :<span style="color:white;font-weight:bold;background:#008F00;padding:0 1ex;">Admin:</span>
| |
− | :The use of this tag may be disabled by setting <tt>$wgJmolAuthorizeJmolSmilesTag</tt> false in {{File|LocalSettings.php}}
| |
− | | |
− | === Tag {{Tag|jmolMol}} ===
| |
− | This tag produces a link that opens a popup JSmol object and loads the model from the [https://cactus.nci.nih.gov/chemical/structure CACTUS] NIH server, constructed from a chemical name. The model is displayed in the default rendering (ball and stick, CPK color, white background).
| |
− | | |
− | By default this tag does the same as {{Tag|jmolSmiles}} but this one may be configured to use a different server.
| |
− | | |
− | Only the name or ID of the molecule must be inserted inside the {{Tag|jmolMol}} tag.
| |
− | | |
− | :''The use of this tag may be disabled by the wiki administrator.''
| |
− | | |
− | Examples:
| |
− | {{Tag|jmolMol}}caffeine{{Tag|/jmolMol}}
| |
− | is rendered as [[MediaWiki/ExtensionV5#1|caffeine]] which, when clicked, will open a JSmol object with the structure of caffeine retrieved from the CACTUS or another server.
| |
− | {{Tag|<nowiki>jmolMol text="something in your coffee"</nowiki>}}caffeine{{Tag|/jmolMol}}
| |
− | is rendered as [[MediaWiki/ExtensionV5#1|something in your coffee]] which, when clicked, will open a JSmol object with the structure of caffeine read from the CACTUS or another server.
| |
− | | |
− | :<span style="color:white;font-weight:bold;background:#008F00;padding:0 1ex;">Admin:</span>
| |
− | :The server to be used may be changed from the default (CACTUS) to any other that can deliver files in a format suitable for Jmol, given their name or another kind of ID.
| |
− | :The use of this tag may be disabled by setting <tt>$wgJmolAuthorizeJmolMolTag</tt> false in {{File|LocalSettings.php}}
| |
− | | |
− | | |
− | = 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 399: |
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) |
− |
| |
− |
| |
− | = Former versions =
| |
− |
| |
− | For documentation on former versions of the Extension, see [[MediaWiki/ExtensionV3]] and [[MediaWiki/ExtensionV4]].
| |