Difference between revisions of "MediaWiki"

From Jmol
Jump to navigation Jump to search
(update Extension version number and link to doc)
(content moved to a new page)
 
(6 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
[http://www.mediawiki.org/ MediaWiki] is an open source wiki engine licensed under the [http://www.gnu.org/copyleft/gpl.html GNU General Public License]. It is used by [[metawikipedia:Sites_using_MediaWiki|many websites]], including this one.
 
[http://www.mediawiki.org/ MediaWiki] is an open source wiki engine licensed under the [http://www.gnu.org/copyleft/gpl.html GNU General Public License]. It is used by [[metawikipedia:Sites_using_MediaWiki|many websites]], including this one.
  
The Jmol Mediawiki Extension enables the use of the Jmol applet inside of Mediawiki pages.
+
The '''Jmol Mediawiki Extension''' enables the use of the '''JSmol''' object inside of Mediawiki pages.
  
'''Current version: 4.2_2.0''', compatible with JSmol
+
'''Current version: 5.1''', compatible with '''JSmol'''
(You can check which version a Wiki is using by going to the <code>[[Special:Version]]</code> page in that Wiki.
+
(You can check which version a Wiki is using by going to the <code>[[Special:Version]]</code> page in that Wiki)
  
:Note that documentation in this page is obsolete; while it gets updated, you can check documentation for the 4.x version at this [http://proteopedia.org/w/User:Jaime_Prilusky/JSmolExtension Proteopedia page]
+
'''Current status: (version 5, JSmol)'''
 
+
* The Jmol Mediawiki Extension is now using JSmol (in HTML5 modality by default, but also compatible with Java modality if you use a web browser that still supports Java applets). Some functionality was added, apart from compatibility with MediaWiki version 1.32.
'''Current status:'''  
+
'''Old status: (version 4, JSmol)'''  
* The Jmol Mediawiki Extension is now using JSmol (in HTML5 modality by default, but also compatible with Java modality)
+
* The Jmol Mediawiki Extension used JSmol (in HTML5 modality by default, but also compatible with Java modality)
 +
'''Older status: (version 3, Jmol-Java)'''
 
* Security is hopefully correct now. The delay effect can be obtained by using [[MediaWiki#Jmol_applet_in_a_popup_window | Jmol applet in a popup window]].
 
* Security is hopefully correct now. The delay effect can be obtained by using [[MediaWiki#Jmol_applet_in_a_popup_window | Jmol applet in a popup window]].
 
* The Jmol Mediawiki Extension is fully functional and stabilized. It currently needs to be modified for a few things: better security, ability to delay loading the applet.
 
* The Jmol Mediawiki Extension is fully functional and stabilized. It currently needs to be modified for a few things: better security, ability to delay loading the applet.
Line 22: Line 23:
 
= How to use the Jmol Extension =
 
= How to use the Jmol Extension =
  
Once the Jmol Extension is installed in the Wiki, you can start adding Jmol applets and controls.
+
Once the Jmol Extension is installed in the Wiki, you can start adding JSmol objects and controls.
  
 
How to know if the Extension is installed, and which version it is? Visit the <code>Special:Version</code> page in your wiki; the extension should be listed there.
 
How to know if the Extension is installed, and which version it is? Visit the <code>Special:Version</code> page in your wiki; the extension should be listed there.
  
== Tags for simple link to Jmol models ==
+
* [[MediaWiki/ExtensionV5|How to use version 5 of the Jmol Extension]]. Compatible with MediaWiki 1.32, PHP 7.0 and JSmol 14.29.32
These tags in a MediaWiki page generate a hyperlink that will open a new window (pop-up) filled with a JmolApplet (the signed version). The applet will fit the window, which is resizable.
+
* [[MediaWiki/ExtensionV4|How to use version 4 of the Jmol Extension]]
 
+
* [[MediaWiki/ExtensionV3|How to use version 3 of the Jmol Extension]]
=== Tag {{Tag|jmolFile}} ===
 
This tag produces a link that opens a JmolApplet 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, black 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.
 
 
 
Examples:
 
{{Tag|jmolFile}}Chair.cml{{Tag|/jmolFile}}
 
is rendered as <jmolFile>Chair.cml</jmolFile> which, when clicked, will open an applet 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 an applet with the model read from [[:File:Ethanol.xyz|File:Ethanol.xyz]].
 
 
 
=== Tag {{Tag|jmolPdb}} ===
 
This tag produces a link that opens a JmolApplet and loads the model from the RCSB [http://www.pdb.org/ PDB] database server. The model is displayed in the default rendering (ball and stick, CPK color, black background).  
 
 
 
Only the 4-character ID of the molecule in the PDB must be inserted inside the {{Tag|jmolPdb}} tag.
 
 
 
Examples:
 
{{Tag|jmolPdb}}2CDS{{Tag|/jmolPdb}}
 
is rendered as <jmolPdb>2CDS</jmolPdb> which, when clicked, will open an applet 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 an applet with the model read from the PDB server.
 
 
 
=== Tag {{Tag|jmolSmiles}} ===
 
This tag produces a link that opens a JmolApplet and loads the model from the [http://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, black background).  
 
 
 
The name or key of the molecule must be inserted inside the {{Tag|jmolSmiles}} tag.
 
 
 
Examples:
 
{{Tag|jmolSmiles}}CCCNC{{Tag|/jmolSmiles}}
 
is rendered as <jmolSmiles>CCCNC</jmolSmiles> which, when clicked, will open an applet 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 an applet with the structure of aspirin read from the CACTUS server.
 
 
 
== Tags that allow more control ==
 
 
 
=== Jmol applet in a MediaWiki page ===
 
 
 
To add a Jmol applet to a MediaWiki page, just add the following:
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolApplet}}
 
    {{Tag|uploadedFileContents}}name of file uploaded in the wiki containing the molecular data{{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> tags.
 
 
 
or
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolApplet}}
 
    {{Tag|wikiPageContents}}page of the wiki containing the molecular data{{Tag|/wikiPageContents}}
 
  {{Tag|/jmolApplet}}
 
{{Tag|/jmol}}
 
 
 
or
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolApplet}}
 
    {{Tag|inlineContents}}contents of the molecular file{{Tag|/inlineContents}}
 
  {{Tag|/jmolApplet}}
 
{{Tag|/jmol}}
 
 
 
or
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolApplet}}
 
    {{Tag|urlContents}}URL of the molecular file{{Tag|/urlContents}}
 
  {{Tag|/jmolApplet}}
 
{{Tag|/jmol}}
 
 
 
: If the file is in a server different than the wiki, you need to use the signed applet ({{Tag|signed}} tag).
 
 
 
=== Controls for the Jmol applet ===
 
 
 
To add a '''button''' to send scripts to the applet, just add the following:
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolButton}}
 
    {{Tag|script}}script to execute{{Tag|/script}}
 
    {{Tag|text}}text of the button{{Tag|/text}}
 
  {{Tag|/jmolButton}}
 
{{Tag|/jmol}}
 
 
 
To add a '''link''' to send scripts to the applet, just add the following:
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolLink}}
 
    {{Tag|script}}script to execute{{Tag|/script}}
 
    {{Tag|text}}text of the link{{Tag|/text}}
 
  {{Tag|/jmolLink}}
 
{{Tag|/jmol}}
 
 
 
To add a '''checkbox''' to send scripts to the applet, just add the following:
 
 
 
{{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|text}}text of the checkbox{{Tag|/text}}
 
  {{Tag|/jmolCheckbox}}
 
{{Tag|/jmol}}
 
 
 
To add a '''group of radio buttons''' to send scripts to the applet, just add the following:
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolRadioGroup}}
 
    {{Tag|item}}
 
      {{Tag|script}}script to execute when the radio button is selected{{Tag|/script}}
 
      {{Tag|text}}text of the radio button{{Tag|/text}}
 
    {{Tag|/item}}
 
    {{Tag|item}}
 
      {{Tag|script}}script to execute when the radio button is selected{{Tag|/script}}
 
      {{Tag|text}}text of the radio button{{Tag|/text}}
 
    {{Tag|/item}}
 
  {{Tag|/jmolRadioGroup}}
 
{{Tag|/jmol}}
 
 
 
To add a '''menu''' to send scripts to the applet, just add the following:
 
 
 
{{Tag|jmol}}
 
  {{Tag|jmolMenu}}
 
    {{Tag|item}}
 
      {{Tag|script}}script to execute when the menu item is selected{{Tag|/script}}
 
      {{Tag|text}}text of the menu item{{Tag|/text}}
 
    {{Tag|/item}}
 
    {{Tag|item}}
 
      {{Tag|script}}script to execute when the menu item is selected{{Tag|/script}}
 
      {{Tag|text}}text of the menu item{{Tag|/text}}
 
    {{Tag|/item}}
 
  {{Tag|/jmolMenu}}
 
{{Tag|/jmol}}
 
 
 
Applets and other controls can be combined in a single {{Tag|jmol}} tag.
 
 
 
=== Jmol applet in a popup window ===
 
 
 
To add a '''button''' that opens a new window containing a Jmol applet, use the {{Tag|JmolAppletButton}} tag instead of the {{Tag|JmolApplet}} tag and also add the {{Tag|text}} tag in it. For example:
 
 
 
{{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|/jmolAppletButton}}
 
{{Tag|/jmol}}
 
 
 
To add a '''link''' that opens a new window containing a Jmol applet, use the {{Tag|JmolAppletLink}} tag instead of the {{Tag|JmolApplet}} tag and also add the {{Tag|text}} tag in it. For example:
 
 
 
{{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|/jmolAppletLink}}
 
{{Tag|/jmol}}
 
 
 
In both cases, the new window will be resizable and the applet inside will resize with it.
 
 
 
''(See also the simple tags above)''
 
 
 
== Reference ==
 
 
 
The {{Tag|jmolFile}}, {{Tag|jmolPdb}} and {{Tag|jmolSmiles}} tags just contain a string that specifies the model to be loaded. They may optionally include a <code>text=</code> attribute that will serve as the link; if omitted, the model string will also be used as the link text.
 
 
 
The {{Tag|jmol}} tag is more complex and will contain sub-tags like the following:
 
* {{Tag|jmolApplet}} : Jmol Applet.
 
** {{Tag|signed}} (<tt>true</tt>, <tt>false</tt>) : To use the signed or unsigned version of the applet. This attribute can be disabled by the Wiki administrator with the <tt>$wgJmolAuthorizeChoosingSignedApplet</tt> setting in {{File|LocalSettings.php}}. Note that signed and unsigned applets cannot be mixed in the same page.
 
** {{Tag|color}} : To set the background color of the Jmol applet (default is black). You can specify it:
 
*** With a named color belonging to the set that is recognized by Jmol.
 
*** With an hexadecimal value in the HTML fomat (e.g. #FF00CC).
 
*** With an hexadecimal value in the Jmol fomat (e.g. [xFF00CC]).
 
** {{Tag|uploadedFileContents}} : Name of an uploaded file in this wiki containing the molecular data to load in the Jmol applet. The Wiki needs to be configured to authorize the upload of molecular data files (using <tt>$wgFileExtensions</tt> in {{File|LocalSettings.php}}). This attribute can be disabled by the Wiki administrator with the <tt>$wgJmolAuthorizeUploadedFile</tt> setting in {{File|LocalSettings.php}}.
 
** {{Tag|wikiPageContents}} : Name of a page of this wiki containing the molecular data to load in the Jmol applet.
 
** {{Tag|urlContents}} : URL of the molecular file to load. This attribute can be disabled by the Wiki administrator with the <tt>$wgJmolAuthorizeUrl</tt> setting in {{File|LocalSettings.php}}.
 
** {{Tag|inlineContents}} : Molecular data to load in the Jmol applet.
 
** {{Tag|size}} : Size of the applet. Only a number should be given, meaning pixels. Only square applets are currently suported (width=height).
 
** {{Tag|script}} : Script to execute right after loading the molecule.
 
** {{Tag|name}} : Name of the Jmol applet (useful if you want to use several Jmol applets in the same page).
 
* {{Tag|jmolButton}} : Button.
 
** {{Tag|script}} : Jmol script to execute when the button is clicked.
 
** {{Tag|text}} : Text of the button.
 
** {{Tag|name}} : Name of the button.
 
** {{Tag|target}} : Name of the Jmol applet linked with the button (useful only if you want to use several Jmol applets in the same page).
 
* {{Tag|jmolLink}} : Link. Same tags as {{Tag|jmolButton}}.
 
* {{Tag|jmolCheckbox}} : Checkbox.
 
** {{Tag|scriptWhenChecked}} : Jmol script to execute when the checkbox is checked.
 
** {{Tag|scriptWhenUnchecked}} : Jmol script to execute when the checkbox is unchecked.
 
** {{Tag|checked}} (<tt>true</tt>, <tt>false</tt>) : Indicates if the checkbox is checked when the page loads.
 
** {{Tag|text}} : Text displayed beside the checkbox.
 
** {{Tag|name}} : Name of the checkbox object.
 
** {{Tag|target}} : Name of the Jmol applet linked with the checkbox (useful only if you want to use several Jmol applets in the same page).
 
* {{Tag|jmolMenu}} : Menu.
 
** {{Tag|item}} : Menu item.
 
*** {{Tag|script}} : Jmol script to execute when the menu item is selected.
 
*** {{Tag|text}} : Text of the menu item.
 
*** {{Tag|checked}} (<tt>true</tt>, <tt>false</tt>) : Indicates if the menu item is selected when the page loads.
 
** {{Tag|name}} : Name of the menu object.
 
** {{Tag|target}} : Name of the Jmol applet linked with the menu (useful only if you want to use several Jmol applets in the same page).
 
** {{Tag|menuHeight}} : Number of visible menu items (1: combo-box, 2 or greater: list with the specified number of lines, -1: calculated). Default is 1.
 
* {{Tag|jmolRadioGroup}} : Group of radio buttons.
 
** {{Tag|item}} : Radio button.
 
*** {{Tag|script}} : Jmol script to execute when the radio button is selected.
 
*** {{Tag|text}} : Text displayed beside the radio button.
 
*** {{Tag|checked}} (<tt>true</tt>, <tt>false</tt>) : Indicates if the radio button is checked when the page loads.
 
** {{Tag|name}} : Name of the radio group.
 
** {{Tag|target}} : Name of the Jmol applet linked with the radio group (useful only if you want to use several Jmol applets in the same page).
 
** {{Tag|vertical}} (<tt>true</tt>, <tt>false</tt>) : Indicates if the radio buttons are stacked vertically or horizontally.
 
* {{Tag|jmolAppletButton}} : A button for opening a new window containing a Jmol Applet. It can contain the same tags as the {{Tag|jmolApplet}} tag, and also the following tags :
 
** {{Tag|title}} : Title of the new window. Defaults to "Jmol".
 
** {{Tag|text}} : Text of the button. Defaults to the contents of {{Tag|title}}.
 
** {{Tag|x}} and {{Tag|y}} : Position of the new window.
 
* {{Tag|jmolAppletLink}} : A link for opening a new window containing a Jmol Applet. Same tags as {{Tag|jmolAppletButton}}.
 
 
 
== Test Pages ==
 
 
 
# A few [[MediaWiki/Basic Example|basic examples]] of the {{tag|jmolFile}}, {{tag|jmolPdb}} and {{tag|jmolSmiles}} tags.
 
# [[Jmol_MediaWiki_Extension | A demo page]] for the {{tag|jmol}} tag
 
# [[Uploaded XYZ File]] -- includes test of {{tag|jmolCheckbox}}, {{tag|jmolLink}}, {{tag|jmolButton}}, and {{tag|jmolMenu}}
 
# [[Uploaded MDL Molfile]]
 
# [[Uploaded CML File]]
 
# [[Jmol in Pop-up| Uploaded PDB File opening in a pop-up]] -- tests <code>jmolAppletLink</code>
 
# [[Inlined MDL Molfile]]
 
# [[Inlined PDB File]]
 
# [[Inlined CML File]]
 
# [[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)
 
  
 
= Installation =
 
= Installation =
 
(''This must be done by the wiki administrator.'')
 
(''This must be done by the wiki administrator.'')
  
The files forming the Jmol Extension are part of the Jmol source code and may hence be retrieved from [{{SVN Trunk}}Jmol-extensions/wiki/MediaWiki/ the SVN system].
+
See [[MediaWiki/Installation]]
 
 
Installation of the Jmol extension is now described on [[:mw:Extension:Jmol#Installing Jmol Extension|the Jmol extension page on MediaWiki]].
 
 
 
You can configure the Jmol extension with several settings added after the above line (default value in '''bold'''):
 
* <tt>$wgJmolAuthorizeChoosingSignedApplet</tt> (<tt>true</tt>, '''<tt>false</tt>''') : Authorize users to choose between the unsigned and the signed Jmol applet.
 
* <tt>$wgJmolAuthorizeUploadedFile</tt> ('''<tt>true</tt>''', <tt>false</tt>) : Authorize the use of {{Tag|uploadedFileContents}}.
 
* <tt>$wgJmolAuthorizeUrl</tt> (<tt>true</tt>, '''<tt>false</tt>''') : Authorize the use of {{Tag|urlContents}}.
 
* <tt>$wgJmolDefaultAppletSize</tt> ('''<tt>400</tt>''') : Size in pixels of the Jmol applet.
 
* <tt>$wgJmolDefaultScript</tt> : Default script.
 
* <tt>$wgJmolExtensionPath ('''extensions/Jmol''')</tt> : Path to the directory where the Jmol extension is installed. This must be an absolute path, therefore if you customize it, make sure it is prepended with <tt>$wgScriptPath</tt> (see example in Jmol.php).
 
* <tt>$wgJmolForceNameSpace</tt> : Force the NameSpace where the applet will go looking for wiki pages containing molecular data (using {{Tag|wikiPageContents}}).
 
* <tt>$wgJmolShowWarnings</tt> ('''<tt>true</tt>''', <tt>false</tt>) : Display warnings when users try to use disabled features.
 
* <tt>$wgJmolUsingSignedAppletByDefault</tt> (<tt>true</tt>, '''<tt>false</tt>''') : Choose if the signed Jmol applet will be used by default. ''Note: the signed Jmol applet is signed with a default certificate. If you want to use the signed Jmol applet in your wiki, I suggest resigning the Jmol applet with your own certificate.''
 
 
 
 
 
'''Note:''' If you want to authorize users to upload files containing molecular data (for using the {{Tag|uploadedFileContents}} tag), you need to do the following:
 
* By default, MediaWiki authorizes the uploading of files whose name ends with a limited number of extensions. For example, if you want to authorize uploading {{File|*.cml}} files, add <tt>$wgFileExtensions[] = 'cml';</tt> in {{File|LocalSettings.php}}.
 
* You can add an icon in the {{Directory|skins/common/images/icons/}} directory for each extension (for example, {{File|fileicon-cml.png}}). In this wiki, we are using [[:Image:Fileicon_Chemical.png|this image]], which leads to the [[:Category:Molecular_Data|following result]].
 
 
 
== Installation of older versions ==
 
 
 
The Jmol Extension below v. 3.3 uses another extension, [[mw:Extension:StubManager|Stub Manager]], so you first need to install it.
 
  
 
= Problems yet to be solved =
 
= Problems yet to be solved =

Latest revision as of 06:25, 23 April 2024

Running Jmol / JSmol

Description

MediaWiki is an open source wiki engine licensed under the GNU General Public License. It is used by many websites, including this one.

The Jmol Mediawiki Extension enables the use of the JSmol object inside of Mediawiki pages.

Current version: 5.1, compatible with JSmol (You can check which version a Wiki is using by going to the Special:Version page in that Wiki)

Current status: (version 5, JSmol)

  • The Jmol Mediawiki Extension is now using JSmol (in HTML5 modality by default, but also compatible with Java modality if you use a web browser that still supports Java applets). Some functionality was added, apart from compatibility with MediaWiki version 1.32.

Old status: (version 4, JSmol)

  • The Jmol Mediawiki Extension used JSmol (in HTML5 modality by default, but also compatible with Java modality)

Older status: (version 3, Jmol-Java)

  • Security is hopefully correct now. The delay effect can be obtained by using Jmol applet in a popup window.
  • The Jmol Mediawiki Extension is fully functional and stabilized. It currently needs to be modified for a few things: better security, ability to delay loading the applet.

Wikis using the Jmol Extension

If you know a Wiki using the Jmol MediaWiki Extension, please add it to the list of Wikis using Jmol.

How to use the Jmol Extension

Once the Jmol Extension is installed in the Wiki, you can start adding JSmol objects and controls.

How to know if the Extension is installed, and which version it is? Visit the Special:Version page in your wiki; the extension should be listed there.

Installation

(This must be done by the wiki administrator.)

See MediaWiki/Installation

Problems yet to be solved

  • Having problems with Jmol applets that are placed below the flow of a link, button, or other user interface element in markup. I get what appears to be a Java error when loading an uploaded file. --Mevans86 18:58, 13 October 2010 (UTC)
  • Does not work with Media wiki 1.17 (and probably 1.15,1.16). I think there was a rewrite of mediawiki code and I get:
Warning: Parameter 1 to Jmol::tag_jmol() expected to be a reference, value given in /var/www/mediawiki/extensions/StubManager/StubManager.php on line 783
--Jacksmind 01:00, 10 October 2010 (UTC)
Hopefully this is solved with version 3.3 of the Extension, since it no longer depends on StubManager. (Still to be confirmed, but it is working fine with MW 1.16 in this site.) --AngelHerraez 12:32, 22 November 2010 (CET)
  • The developers at WikiMedia / WikiMedia Commons / Wikipedia apparently advocate the use of a simpler way of inserting Jmol applets, by just linking to the (previously uploaded) model file (as it is done e.g. with images) and having the server decide upon the way to handle it, with something simpler than the current Extension (see a discussion about this).
However, in my opinion rendering of a 3D molecular model clearly calls for something more flexible than a simple, barebone viewer with default settings. Maybe we would have to resort to a simpler extension for Wikipedia and a full one for other wikis?
New tags are available since version 3.3 of the extension, which are much more simple to use (<jmolFile>, <jmolPdb>, <jmolSmiles>), but are currently not flexible. A solution to explore may be the use of HTML templates to give the opporunity to choose between differently configured viewers (with different controls and informations). --NicolasVervelle 22:44, 28 November 2010 (CET)
  • An interesting feature would be the server-side automation of the snapshot ability of the Jmol application, so that images are generated into the wiki page as a thumbnail that will link to --or be replaced by-- the applet when the user clicks on the image, or on a link below it (see an example of this idea, though not server-generated).
  • I have just upgraded to MediaWiki 1.18.1 and I now have:
Warning: Parameter 3 to Jmol::jmolPdbTag() expected to be a reference, value given in /var/www/SklogWiki/includesparser/Parser.php on line 3580
Any advice? --SklogWiki 19:31, 31 January 2012 (CET)


Already solved

These are left here for reference, as you may still have these problems depending on your version of MediaWiki or your version of the Jmol MediaWiki Extension.

  • The installation does not work when the wiki is installed in a non-root folder of the server (e.g. http://www.myserver.com/mywiki/index.php instead of http://mywiki.myserver.com/index.php).
Fixed (2008-Nov-29) in revision 10393.
  • Using <jmolAppletButton> or <jmolAppletlink> throws an error in Internet Explorer: "Invalid argument", and prevents the pop-up.
Partially fixed (2008-Dec-2) in revision 10411.
Completely fixed (2008-Dec-8) in revision 10467.
  • The scripts associated to checkboxes rendered by <jmolCheckbox> have no effect on the applet.
Fixed (2008-Dec-8) in revision 10467.
This was the discussion of the problem:

(Bob) something in File icon.gif/skins/common/wikibits.js?97 is disabling checkboxes.
(Nico) Yes, good catch, thanks a lot. Now, I need to find a way to overcome the behaviour of setupCheckboxShiftClick(). I am going to ask on mediawiki list.
(Bugzilla) discussion

The problem was due to a conflict in the onClick event for checkboxes correctly written by the Jmol Extension and a javascript library (File icon.gifwikibits.js) included in MediaWiki. The offending js function is now overwritten by the extension.
  • Since Jmol scripting can include a call to javascript commands, the Jmol applet inserted by the Jmol MediaWiki Extension can execute arbitrary javascript added by any user editing the page (see demo). This is an unacceptable security hole for some systems such as Wikipedia, and will prevent Jmol from being used there. There is hence a need to implement a "scripting-without-javascript" mode of the applet, i.e. a way to completely disable the javascript command in Jmol scripts run from the MediaWiki Extension.
Fixed (2008-Dec-8) in revision 10467.
No javascript will be executed by Jmol applets inserted by the Extension.
  • The signed applet was not being used even when explicitly authorized in the wiki configuration ($wgJmolAuthorizeChoosingSignedApplet=true) and requested for the applet (<signed>true</signed>).
Fixed (2008-Dec-8) in revision 10467.
Now you can also have both signed and unsigned applets in the same page.
  • Inserting applets with models read from php pages fails. The applet is using the <urlContents> tag and the url contains the '&' character.
Fixed (2009-Nov-13) in revision 11738, version 3.2 of the Extension.
The '&' is not tolerated by the wikicode. The solution is to use %26 (the wikicode for &) instead of the ampersand(s) in the url, content of the <urlContents> tag. The Extension will later filter those %26 codes and convert them to & so that the server correctly provides the model.

External links