|
|
(67 intermediate revisions by 10 users not shown) |
Line 1: |
Line 1: |
− | __TOC__
| + | {{Running_Jmol_Sections}} |
| = Description = | | = Description = |
| | | |
| [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. This [[Jmol_MediaWiki_Extension|simple page]] demonstrates how to use the extension. | + | The '''Jmol Mediawiki Extension''' enables the use of the '''JSmol''' object inside of Mediawiki pages. |
| | | |
− | '''Current status:''' the Jmol Mediawiki Extension is fully functional and stabilized. It currently needs production testing. | + | '''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) |
| | | |
| + | '''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 [[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. |
| | | |
| = Wikis using the Jmol Extension = | | = Wikis using the Jmol Extension = |
| | | |
− | If you know a Wiki using the Jmol MediaWiki Extension, please add it in the following list: | + | If you know a Wiki using the Jmol MediaWiki Extension, please add it to the list of [[Wikis_Using_Jmol |Wikis using Jmol]]. |
− | * [[Main_Page|This]] wiki
| |
− | * [http://fahwiki.net/ Folding@Home] wiki
| |
− | * [http://www.ch.ic.ac.uk/wiki/index.php/Second_Year_Modelling_Workshop Molecular modelling workshop@Imperial College]
| |
| | | |
| = 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. |
| | | |
− | == Simple usage ==
| + | 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. |
| | | |
− | === Jmol applet in a MediaWiki page ===
| + | * [[MediaWiki/ExtensionV5|How to use version 5 of the Jmol Extension]]. Compatible with MediaWiki 1.32, PHP 7.0 and JSmol 14.29.32 |
− | | + | * [[MediaWiki/ExtensionV4|How to use version 4 of the Jmol Extension]] |
− | To add a Jmol applet to a MediaWiki page, just add the following:
| + | * [[MediaWiki/ExtensionV3|How to use version 3 of the Jmol Extension]] |
− | | |
− | {{Tag|jmol}}
| |
− | {{Tag|jmolApplet}}
| |
− | {{Tag|uploadedFileContents}}file uploaded in the wiki containing the molecular data{{Tag|/uploadedFileContents}}
| |
− | {{Tag|/jmolApplet}}
| |
− | {{Tag|/jmol}}
| |
− | | |
− | 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}}
| |
− | | |
− | === Controls for the Jmol applet ===
| |
− | | |
− | To add buttons 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 links 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 checkboxes 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 radio groups 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 menus 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 with 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 with 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}}
| |
− | | |
− | == Reference ==
| |
− | | |
− | The {{Tag|jmol}} tag can contain the following:
| |
− | * {{Tag|jmolApplet}} : Jmol Applet.
| |
− | ** {{Tag|signed}} (<tt>true</tt>, <tt>false</tt>) : On the first Jmol applet 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}}.
| |
− | ** {{Tag|color}} : To change the background color of the Jmol applet.
| |
− | ** {{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}}).
| |
− | ** {{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.
| |
− | ** {{Tag|script}} : Script to execute at startup.
| |
− | ** {{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 by default.
| |
− | ** {{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|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 checked.
| |
− | ** {{Tag|name}} : Name of the menu.
| |
− | ** {{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).
| |
− | * {{Tag|jmolRadioGroup}} : Radio group.
| |
− | ** {{Tag|item}} : Radio button.
| |
− | *** {{Tag|script}} : Jmol script to execute when the radio button is selected.
| |
− | *** {{Tag|text}} : Text of the radio button. | |
− | *** {{Tag|checked}} (<tt>true</tt>, <tt>false</tt>) : Indicates if the radio button is checked.
| |
− | ** {{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 with a Jmol Applet. It can contains the same tags as the {{Tag|jmolApplet}} tag, and also the following tags :
| |
− | ** {{Tag|text}} : Text of the button.
| |
− | ** {{Tag|title}} : Title of the new window (''doesn't work for the moment'').
| |
− | ** {{Tag|x}} and {{Tag|y}} : Position of the new window.
| |
− | * {{Tag|jmolAppletLink}} : A link for opening a new window with a Jmol Applet. Same tags as {{Tag|jmolAppletButton}}.
| |
− | | |
− | == Test Pages ==
| |
− | | |
− | # [[Uploaded XYZ File]]
| |
− | # [[Uploaded MDL Molfile]]
| |
| | | |
| = Installation = | | = Installation = |
| + | (''This must be done by the wiki administrator.'') |
| | | |
− | [http://www.jmol.org/files/ Download Jmol] and extract all the files in a temporary directory. | + | See [[MediaWiki/Installation]] |
− | | |
− | Create the directory {{Directory|Jmol}} in {{Directory|$mediawiki/extensions}}, and copy the following files in it:
| |
− | * {{File|COPYRIGHT.txt}}
| |
− | * {{File|Jmol.js}}
| |
− | * {{File|JmolApplet_i18n.jar}} and {{File|JmolApplet0.jar}} to {{File|JmolApplet6.jar}}
| |
− | * {{File|JmolAppletSigned_i18n.jar}} and {{File|JmolAppletSigned0.jar}} to {{File|JmolAppletSigned6.jar}}, if you want to be able to use the signed applet.
| |
− | * {{File|LICENSE.txt}}
| |
− | * {{File|README.txt}}
| |
− | | |
− | | |
− | Add the following line to the end of {{File|LocalSettings.php}}:
| |
− | require_once('extensions/Jmol/JmolExtension.php');
| |
− | | |
− | | |
− | You can configure the Jmol extension with several settings added after the above line (default value in '''bold'''):
| |
− | * <tt>$wgJmolAuthorizeUrl</tt> (<tt>true</tt>, '''<tt>false</tt>''') : Authorize the use of {{Tag|urlContents}}.
| |
− | * <tt>$wgJmolAuthorizeChoosingSignedApplet</tt> (<tt>true</tt>, '''<tt>false</tt>''') : Authorize users to choose between the unsigned and the signed Jmol applet.
| |
− | * <tt>$wgJmolDefaultAppletSize</tt> ('''<tt>400</tt>''') : Size in pixels of the Jmol applet.
| |
− | * <tt>$wgJmolDefaultScript</tt> : Default script.
| |
− | * <tt>$wgJmolExtensionPath</tt> : Path to the directory where the Jmol extension is installed.
| |
− | * <tt>$wgJmolForceNameSpace</tt> : Force the NameSpace where the applet will go looking for wiki pages containing molecular data (using {{Tag|wikiPageContents}}).
| |
− | * <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 certificat. If you want to use the signed Jmol applet in your wiki, I suggest resigning the Jmol applet with your own certificate.''
| |
| | | |
| + | = Problems yet to be solved = |
| | | |
− | '''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:
| + | * 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. --[[User:Mevans86|Mevans86]] 18:58, 13 October 2010 (UTC) |
− | * 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]].
| |
| | | |
| + | * 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 |
| + | : --[[User:Jacksmind|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.) --[[User:AngelHerraez|AngelHerraez]] 12:32, 22 November 2010 (CET) |
| | | |
− | Copy the following code and paste it into {{File|extensions/Jmol/JmolMediaWiki.js}}:
| + | * 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 [https://bugzilla.wikimedia.org/show_bug.cgi?id=16491 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 ({{Tag|jmolFile}}, {{tag|jmolPdb}}, {{tag|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). --[[User:NicolasVervelle|NicolasVervelle]] 22:44, 28 November 2010 (CET) |
| | | |
− | <pre>/*
| + | * 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 [[User:Bduke#How_should_molecules_be_shown_on_Wikipedia | example]] of this idea, though not server-generated). |
− | * Copyright (C) 2006 Nicolas Vervelle, The Jmol Development Team
| |
− | *
| |
− | * Contact: nico@jmol.org, jmol-developers@lists.sf.net
| |
− | *
| |
− | * This library is free software; you can redistribute it and/or
| |
− | * modify it under the terms of the GNU Lesser General Public
| |
− | * License as published by the Free Software Foundation; either
| |
− | * version 2.1 of the License, or (at your option) any later version.
| |
− | *
| |
− | * This library is distributed in the hope that it will be useful,
| |
− | * but WITHOUT ANY WARRANTY; without even the implied warranty of
| |
− | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
| |
− | * Lesser General Public License for more details.
| |
− | *
| |
− | * You should have received a copy of the GNU Lesser General Public
| |
− | * License along with this library; if not, write to the Free Software
| |
− | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
| |
− | */
| |
| | | |
− | function jmolWikiPopupWindow(extensionPath, windowTitle, windowSize, windowLeft, windowTop, windowCode) {
| + | * I have just upgraded to MediaWiki 1.18.1 and I now have: |
− | var windowWidth = parseInt(windowSize) + 15;
| + | :Warning: Parameter 3 to Jmol::jmolPdbTag() expected to be a reference, value given in /var/www/SklogWiki/includesparser/Parser.php on line 3580 |
− | var windowHeight = parseInt(windowSize) + 15;
| + | :Any advice? --[[User:SklogWiki|SklogWiki]] 19:31, 31 January 2012 (CET) |
− | var opt = "width=" + windowWidth + "," +
| |
− | "height=" + windowHeight + "," +
| |
− | "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1," +
| |
− | "left=" + windowLeft + ",top=" + windowTop ;
| |
− | var s =
| |
− | "<html><head>\n" +
| |
− | "<script language='Javascript' type='text/javascript' src='" + extensionPath + "/Jmol.js'></script>\n" +
| |
− | "<title>" + windowTitle + "</title>\n" +
| |
− | "</head><body>" +
| |
− | "<script language='Javascript' type='text/javascript'>\n" + windowCode + "\n</script>\n" +
| |
− | "</body></html>";
| |
− | | |
− | var w = open("", windowTitle, opt);
| |
− | w.document.open();
| |
− | w.document.write(s);
| |
− | w.document.close();
| |
− | w.focus();
| |
− | }</pre>
| |
− | | |
− | | |
− | Copy the following code and paste it into {{File|extensions/Jmol/JmolExtension.php}}:
| |
− | | |
− | <pre><?php | |
− | | |
− | /*
| |
− | * Copyright (C) 2006 Nicolas Vervelle, The Jmol Development Team
| |
− | *
| |
− | * Contact: nico@jmol.org, jmol-developers@lists.sf.net
| |
− | *
| |
− | * This library is free software; you can redistribute it and/or
| |
− | * modify it under the terms of the GNU Lesser General Public
| |
− | * License as published by the Free Software Foundation; either
| |
− | * version 2.1 of the License, or (at your option) any later version.
| |
− | *
| |
− | * This library is distributed in the hope that it will be useful,
| |
− | * but WITHOUT ANY WARRANTY; without even the implied warranty of
| |
− | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
| |
− | * Lesser General Public License for more details.
| |
− | *
| |
− | * You should have received a copy of the GNU Lesser General Public
| |
− | * License along with this library; if not, write to the Free Software
| |
− | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
| |
− | */
| |
| | | |
− | if (defined('MEDIAWIKI')) {
| |
− |
| |
− | require_once("$IP/includes/Title.php");
| |
− |
| |
− | global $wgJmolAuthorizeUrl;
| |
− | global $wgJmolAuthorizeChoosingSignedApplet;
| |
− | global $wgJmolDefaultAppletSize;
| |
− | global $wgJmolDefaultScript;
| |
− | global $wgJmolExtensionPath;
| |
− | global $wgJmolForceNameSpace;
| |
− | global $wgJmolUsingSignedAppletByDefault;
| |
− |
| |
− | /* Global configuration parameters */
| |
− | $wgJmolAuthorizeUrl = false;
| |
− | $wgJmolAuthorizeChoosingSignedApplet = false;
| |
− | $wgJmolDefaultAppletSize = "400";
| |
− | $wgJmolDefaultScript = "";
| |
− | $wgJmolExtensionPath = $wgScriptPath."/extensions/Jmol";
| |
− | $wgJmolForceNameSpace = "";
| |
− | $wgJmolUsingSignedAppletByDefault = false;
| |
− |
| |
− | /* Class containing all the code for the Jmol Extension */
| |
− | $wfJmolReleaseVersion = true;
| |
− | class JmolExtension {
| |
− | var $mOutput, $mDepth;
| |
− | var $mCurrentObject, $mCurrentTag, $mCurrentSubTag;
| |
− |
| |
− | var $mValChecked;
| |
− | var $mValColor;
| |
− | var $mValInlineContents;
| |
− | var $mValItems;
| |
− | var $mValMenuHeight;
| |
− | var $mValName;
| |
− | var $mValPositionX;
| |
− | var $mValPositionY;
| |
− | var $mValScript;
| |
− | var $mValScriptWhenChecked;
| |
− | var $mValScriptWhenUnchecked;
| |
− | var $mValSigned;
| |
− | var $mValSize;
| |
− | var $mValTarget;
| |
− | var $mValText;
| |
− | var $mValTitle;
| |
− | var $mValUploadedFileContents;
| |
− | var $mValUrlContents;
| |
− | var $mValVertical;
| |
− | var $mValWikiPageContents;
| |
− |
| |
− | function JmolExtension() {
| |
− | $this->mOutput = "";
| |
− | $this->mDepth = 0;
| |
− | $this->resetValues();
| |
− | }
| |
− |
| |
− | function renderJmol($input) {
| |
− | $this->mOutput = "";
| |
− | $this->mDepth = 0;
| |
− | $xmlParser = xml_parser_create();
| |
− | xml_set_object($xmlParser, $this);
| |
− | xml_set_element_handler($xmlParser, "startElement", "endElement");
| |
− | xml_set_character_data_handler($xmlParser, "characterData");
| |
− | $input = "<jmol>$input<jmol>";
| |
− | if (!xml_parse($xmlParser, $input)) {
| |
− | die(sprintf(
| |
− | "XML error: %s at line %d",
| |
− | xml_error_string(xml_get_error_code($xmlParser)),
| |
− | xml_get_current_line_number($xmlParser)));
| |
− | }
| |
− | xml_parser_free($xmlParser);
| |
− | return $this->mOutput;
| |
− | }
| |
− |
| |
− | // Renders a Jmol applet directly in the Wiki page
| |
− | function renderJmolApplet() {
| |
− | global $wgJmolExtensionPath;
| |
− |
| |
− | $this->mValInlineContents = trim($this->mValInlineContents);
| |
− | $this->mValInlineContents = preg_replace("/\t/", " ", $this->mValInlineContents);
| |
− | $this->mValInlineContents = preg_replace("/\n/", "\\n'+\n'", $this->mValInlineContents);
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript' src='".$wgJmolExtensionPath."/Jmol.js'></script>\n";
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript'>\n".
| |
− | $this->renderInternalJmolApplet("'")."\n".
| |
− | "</script>\n";
| |
− | }
| |
− |
| |
− | // Renders a button in the Wiki page that will open a new window containing a Jmol applet
| |
− | function renderJmolAppletButton() {
| |
− | global $wgJmolExtensionPath;
| |
− |
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript' src='".$wgJmolExtensionPath."/JmolMediaWiki.js'></script>\n";
| |
− | $this->mOutput .= "<input type='button'";
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= " name='".$this->mValName."' id='".$this->mValName."'";
| |
− | }
| |
− | if ($this->mValText == "") {
| |
− | $this->mValText = $this->mValTitle;
| |
− | }
| |
− | if ($this->mValText != "") {
| |
− | $this->mOutput .= " value='".$this->mValText."'";
| |
− | }
| |
− | $this->mOutput .=
| |
− | " onclick=\"jmolWikiPopupWindow('".$wgJmolExtensionPath."',".
| |
− | "'".$this->mValTitle."',".
| |
− | "'".$this->mValSize."',".
| |
− | "'".$this->mValPositionX."',".
| |
− | "'".$this->mValPositionY."',".
| |
− | "'".$this->renderInternalJmolApplet("\\'")."');return true\"";
| |
− | $this->mOutput .= "/>";
| |
− | }
| |
− |
| |
− | // Renders a button in the Wiki page that will open a new window containing a Jmol applet
| |
− | function renderJmolAppletLink() {
| |
− | global $wgJmolExtensionPath;
| |
− |
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript' src='".$wgJmolExtensionPath."/JmolMediaWiki.js'></script>\n";
| |
− | $this->mOutput .= "<a";
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= " name='".$this->mValName."' id='".$this->mValName."'";
| |
− | }
| |
− | $this->mOutput .=
| |
− | " href=\"javascript:jmolWikiPopupWindow('".$wgJmolExtensionPath."',".
| |
− | "'".$this->mValTitle."',".
| |
− | "'".$this->mValSize."',".
| |
− | "'".$this->mValPositionX."',".
| |
− | "'".$this->mValPositionY."',".
| |
− | "'".$this->renderInternalJmolApplet("\\'")."');\"";
| |
− | $this->mOutput .= ">";
| |
− | if ($this->mValText == "") {
| |
− | $this->mValText = $this->mValTitle;
| |
− | }
| |
− | if ($this->mValText != "") {
| |
− | $this->mOutput .= $this->mValText;
| |
− | }
| |
− | $this->mOutput .= "</a>";
| |
− | }
| |
− |
| |
− | // Renders a button to control a Jmol applet
| |
− | function renderJmolButton() {
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript'>\n";
| |
− | if ($this->mValTarget != "") {
| |
− | $this->mOutput .= "jmolSetTarget('".$this->mValTarget."');\n";
| |
− | }
| |
− | $this->mOutput .=
| |
− | "jmolButton('".$this->mValScript."','".$this->mValText."'";
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= ",'".$this->mValName."'";
| |
− | }
| |
− | $this->mOutput .= ");\n".
| |
− | "</script>\n";
| |
− | }
| |
− |
| |
− | // Renders a checkbox to control a Jmol applet
| |
− | function renderJmolCheckbox() {
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript'>\n";
| |
− | if ($this->mValTarget != "") {
| |
− | $this->mOutput .= "jmolSetTarget('".$this->mValTarget."');\n";
| |
− | }
| |
− | $this->mOutput .=
| |
− | "jmolCheckbox('".$this->mValScriptWhenChecked."',".
| |
− | "'".$this->mValScriptWhenUnchecked."',".
| |
− | "'".$this->mValText."'";
| |
− | if ($this->mValChecked) {
| |
− | $this->mOutput .= ",true";
| |
− | } else {
| |
− | $this->mOutput .= ",false";
| |
− | }
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= ",'".$this->mValName."'";
| |
− | }
| |
− | $this->mOutput .= ");\n".
| |
− | "</script>\n";
| |
− | }
| |
− |
| |
− | // Renders a link to control a Jmol applet
| |
− | function renderJmolLink() {
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript'>\n";
| |
− | if ($this->mValTarget != "") {
| |
− | $this->mOutput .= "jmolSetTarget('".$this->mValTarget."');\n";
| |
− | }
| |
− | $this->mOutput .=
| |
− | "jmolLink('".$this->mValScript."','".$this->mValText."'";
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= ",'".$this->mValName."'";
| |
− | }
| |
− | $this->mOutput .= ");\n".
| |
− | "</script>\n";
| |
− | }
| |
− |
| |
− | // Renders a menu to control a Jmol applet
| |
− | function renderJmolMenu() {
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript'>\n";
| |
− | if ($this->mValTarget != "") {
| |
− | $this->mOutput .= "jmolSetTarget('".$this->mValTarget."');\n";
| |
− | }
| |
− | $this->mOutput .=
| |
− | "jmolMenu([".$this->mValItems."],".$this->mValMenuHeight;
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= ",'".$this->mValName."'";
| |
− | }
| |
− | $this->mOutput .= ");\n".
| |
− | "</script>\n";
| |
− | }
| |
− |
| |
− | // Renders a radio group to control a Jmol applet
| |
− | function renderJmolRadioGroup() {
| |
− | $this->mOutput .= "<script language='Javascript' type='text/javascript'>\n";
| |
− | if ($this->mValTarget != "") {
| |
− | $this->mOutput .= "jmolSetTarget('".$this->mValTarget."');\n";
| |
− | }
| |
− | $this->mOutput .=
| |
− | "jmolRadioGroup([".$this->mValItems."]";
| |
− | if ($this->mValVertical) {
| |
− | $this->mOutput .= ",jmolBr()";
| |
− | } else {
| |
− | $this->mOutput .= ",' '";
| |
− | }
| |
− | if ($this->mValName != "") {
| |
− | $this->mOutput .= ",'".$this->mValName."'";
| |
− | }
| |
− | $this->mOutput .= ");\n".
| |
− | "</script>\n";
| |
− | }
| |
− |
| |
− | // Internal function to make a Jmol applet
| |
− | function renderInternalJmolApplet($sep) {
| |
− | global $wgJmolAuthorizeUrl, $wgJmolForceNameSpace;
| |
− | global $wgJmolExtensionPath;
| |
− | $output = "";
| |
− |
| |
− | if ($this->mValSigned) {
| |
− | $output .= "jmolInitialize(".$sep.$wgJmolExtensionPath.$sep.", true);";
| |
− | } else {
| |
− | $output .= "jmolInitialize(".$sep.$wgJmolExtensionPath.$sep.", false);";
| |
− | }
| |
− | $output .=
| |
− | "jmolCheckBrowser(".$sep."popup".$sep.", ".$sep.$wgJmolExtensionPath."/browsercheck".$sep.", ".$sep."onClick".$sep.");".
| |
− | "jmolSetAppletColor(".$sep.$this->mValColor.$sep.");";
| |
− | if ($this->mValUploadedFileContents != "") {
| |
− | $title = Title::makeTitleSafe(NS_IMAGE, $this->mValUploadedFileContents);
| |
− | $article = new Article($title);
| |
− | if (!is_null($title) && $article->exists()) {
| |
− | $file = new Image($title);
| |
− | $this->mValUrlContents = $file->getURL();
| |
− | }
| |
− | }
| |
− | if ($this->mValWikiPageContents != "") {
| |
− | $this->mValUrlContents = "/index.php?title=";
| |
− | if ($wgJmolForceNameSpace != "") {
| |
− | $this->mValUrlContents .= $wgJmolForceNameSpace.":";
| |
− | }
| |
− | $this->mValUrlContents .= $this->mValWikiPageContents."&action=raw";
| |
− | }
| |
− | if (($this->mValUrlContents != "") && ($wgJmolAuthorizeUrl == true)) {
| |
− | $output .=
| |
− | "jmolApplet(".$this->mValSize.", ".
| |
− | $sep."load ".$this->mValUrlContents."; ".$this->mValScript.$sep;
| |
− | } else {
| |
− | $output .=
| |
− | "jmolAppletInline(".$this->mValSize.", ".
| |
− | $sep.$this->mValInlineContents.$sep.", ".
| |
− | $sep.$this->mValScript.$sep;
| |
− | }
| |
− | if ($this->mValName != "") {
| |
− | $output .= ",".$sep.$this->mValName.$sep;
| |
− | }
| |
− | $output .=
| |
− | ");".
| |
− | "jmolBr();";
| |
− |
| |
− | return $output;
| |
− | }
| |
− |
| |
− | // Function called when an opening XML tag is found
| |
− | function startElement($parser, $name, $attrs) {
| |
− | $this->mDepth += 1;
| |
− | switch ($this->mDepth) {
| |
− | case 1:
| |
− | // JMOL tag itself
| |
− | $this->resetValues();
| |
− | break;
| |
− | case 2:
| |
− | // The interesting tags
| |
− | $this->resetValues();
| |
− | $this->mCurrentObject = $name;
| |
− | break;
| |
− | case 3:
| |
− | // Details of the interesting tags
| |
− | $this->mCurrentTag = $name;
| |
− | break;
| |
− | case 4:
| |
− | // Details of sub tags
| |
− | $this->mCurrentSubTag = $name;
| |
− | break;
| |
− | }
| |
− | }
| |
− |
| |
− | // Function called when a closing XML tag is found
| |
− | function endElement($parser, $name) {
| |
− | switch ($this->mDepth) {
| |
− | case 1:
| |
− | // JMOL tag itself
| |
− | $this->resetValues();
| |
− | break;
| |
− | case 2:
| |
− | // The interesting tags
| |
− | switch ($this->mCurrentObject) {
| |
− | case "JMOLAPPLET":
| |
− | $this->renderJmolApplet();
| |
− | break;
| |
− | case "JMOLAPPLETBUTTON":
| |
− | $this->renderJmolAppletButton();
| |
− | break;
| |
− | case "JMOLAPPLETLINK":
| |
− | $this->renderJmolAppletLink();
| |
− | break;
| |
− | case "JMOLBUTTON":
| |
− | $this->renderJmolButton();
| |
− | break;
| |
− | case "JMOLCHECKBOX":
| |
− | $this->renderJmolCheckbox();
| |
− | break;
| |
− | case "JMOLLINK":
| |
− | $this->renderJmolLink();
| |
− | break;
| |
− | case "JMOLMENU":
| |
− | $this->renderJmolMenu();
| |
− | break;
| |
− | case "JMOLRADIOGROUP":
| |
− | $this->renderJmolRadioGroup();
| |
− | break;
| |
− | }
| |
− | $this->resetValues();
| |
− | break;
| |
− | case 3:
| |
− | // Details of the interesting tags
| |
− | switch ($this->mCurrentTag) {
| |
− | case "ITEM":
| |
− | if ($this->mValItems != "") {
| |
− | $this->mValItems .= ",";
| |
− | }
| |
− | $this->mValItems .= "['".$this->mValScript."'";
| |
− | $this->mValItems .= ",'".$this->mValText."'";
| |
− | if ($this->mValChecked) {
| |
− | $this->mValItems .= ",true]";
| |
− | } else {
| |
− | $this->mValItems .= ",false]";
| |
− | }
| |
− | break;
| |
− | }
| |
− | $this->mCurrentTag = "";
| |
− | break;
| |
− | case 4:
| |
− | // Details of sub tags
| |
− | $this->mCurrentSubTag = "";
| |
− | break;
| |
− | }
| |
− | $this->mDepth -= 1;
| |
− | }
| |
− |
| |
− | // Function called for the content of a XML tag
| |
− | function characterData($parser, $data) {
| |
− | global $wgJmolAuthorizeChoosingSignedApplet;
| |
− |
| |
− | switch ($this->mDepth) {
| |
− | case 3:
| |
− | // Details of the interesting tags
| |
− | switch ($this->mCurrentTag) {
| |
− | case "CHECKED":
| |
− | $this->mValChecked = $data;
| |
− | break;
| |
− | case "COLOR":
| |
− | $this->mValColor = $data;
| |
− | break;
| |
− | case "INLINECONTENTS":
| |
− | case "ONLINECONTENTS":
| |
− | $data = trim($data);
| |
− | if ($data != "") {
| |
− | $this->mValInlineContents .= "\n" . $data;
| |
− | }
| |
− | break;
| |
− | case "MENUHEIGHT":
| |
− | $this->mValMenuHeight = $data;
| |
− | break;
| |
− | case "NAME":
| |
− | $this->mValName = $data;
| |
− | break;
| |
− | case "SCRIPT":
| |
− | $this->mValScript = $data;
| |
− | break;
| |
− | case "SCRIPTWHENCHECKED":
| |
− | $this->mValScriptWhenChecked = $data;
| |
− | break;
| |
− | case "SCRIPTWHENUNCHECKED":
| |
− | $this->mValScriptWhenUnchecked = $data;
| |
− | break;
| |
− | case "SIGNED":
| |
− | if ($wgJmolAuthorizeChoosingSignedApplet) {
| |
− | $this->mValSigned = $data;
| |
− | }
| |
− | break;
| |
− | case "SIZE":
| |
− | $this->mValSize = $data;
| |
− | break;
| |
− | case "TARGET":
| |
− | $this->mValTarget = $data;
| |
− | break;
| |
− | case "TEXT":
| |
− | $this->mValText = $data;
| |
− | break;
| |
− | case "TITLE":
| |
− | $this->mValTitle = $data;
| |
− | break;
| |
− | case "UPLOADEDFILECONTENTS":
| |
− | $this->mValUploadedFileContents = $data;
| |
− | break;
| |
− | case "URLCONTENTS":
| |
− | $this->mValUrlContents = $data;
| |
− | break;
| |
− | case "VERTICAL":
| |
− | $this->mValVertical = $data;
| |
− | break;
| |
− | case "WIKIPAGECONTENTS":
| |
− | $this->mValWikiPageContents = $data;
| |
− | break;
| |
− | case "X":
| |
− | $this->mValPositionX = $data;
| |
− | break;
| |
− | case "Y":
| |
− | $this->mValPositionY = $data;
| |
− | break;
| |
− | }
| |
− | break;
| |
− | case 4:
| |
− | // Details of sub tags
| |
− | if ($this->mCurrentTag == "ITEM") {
| |
− | switch ($this->mCurrentSubTag) {
| |
− | case "CHECKED":
| |
− | $this->mValChecked = $data;
| |
− | break;
| |
− | case "SCRIPT":
| |
− | $this->mValScript = $data;
| |
− | break;
| |
− | case "TEXT":
| |
− | $this->mValText = $data;
| |
− | break;
| |
− | }
| |
− | }
| |
− | break;
| |
− | }
| |
− | }
| |
− |
| |
− | // Resets internal variables to their default values
| |
− | function resetValues() {
| |
− | global $wgJmolDefaultAppletSize;
| |
− | global $wgJmolDefaultScript;
| |
− | global $wgJmolUsingSignedAppletByDefault;
| |
− |
| |
− | $this->mCurrentObject = "";
| |
− | $this->mCurrentTag = "";
| |
− | $this->mCurrentSubTag = "";
| |
− |
| |
− | $this->mValChecked = false;
| |
− | $this->mValColor = "black";
| |
− | $this->mValInlineContents = "";
| |
− | $this->mValItems = "";
| |
− | $this->mValMenuHeight = "1";
| |
− | $this->mValName = "";
| |
− | $this->mValPositionX = "100";
| |
− | $this->mValPositionY = "100";
| |
− | $this->mValScript = $wgJmolDefaultScript;
| |
− | $this->mValScriptWhenChecked = "";
| |
− | $this->mValScriptWhenUnchecked = "";
| |
− | $this->mValSigned = $wgJmolUsingSignedAppletByDefault;
| |
− | $this->mValSize = $wgJmolDefaultAppletSize;
| |
− | $this->mValTarget = "";
| |
− | $this->mValText = "";
| |
− | $this->mValTitle = "Jmol";
| |
− | $this->mValUploadedFileContents = "";
| |
− | $this->mValUrlContents = "";
| |
− | $this->mValVertical = false;
| |
− | $this->mValWikiPageContents = "";
| |
− | }
| |
− | };
| |
− |
| |
− | // Enables to have a Release and Development versions running simultaneously
| |
− | if ($wfJmolReleaseVersion) {
| |
− | $wgExtensionFunctions[] = "wfJmolExtension";
| |
− |
| |
− | $wgJmolExtension = new JmolExtension;
| |
− |
| |
− | $wgExtensionCredits['other'][] = array(
| |
− | 'name' => 'Jmol Extension for MediaWiki',
| |
− | 'description' => 'adds the possibility to include Jmol applets in MediaWiki.',
| |
− | 'author' => 'Nicolas Vervelle, Jmol Development Team',
| |
− | 'url' => 'http://wiki.jmol.org/index.php/MediaWiki'
| |
− | );
| |
− |
| |
− | function wfJmolExtension() {
| |
− | global $wgParser;
| |
− | $wgParser->setHook( "jmol", "wfRenderJmol" );
| |
− | }
| |
| | | |
− | function wfRenderJmol($input) {
| + | == Already solved == |
− | global $wgJmolExtension;
| + | 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. |
− | return $wgJmolExtension->renderJmol($input);
| |
− | }
| |
− | } else {
| |
− | $wgExtensionFunctions[] = "wfJmolDevExtension";
| |
| | | |
− | $wgJmolDevExtension = new JmolDevExtension;
| + | * The installation does not work when the wiki is installed in a non-root folder of the server (e.g. <nowiki>http://www.myserver.com/mywiki/index.php</nowiki> instead of <nowiki>http://mywiki.myserver.com/index.php</nowiki>). |
| + | : '''Fixed''' (2008-Nov-29) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ revision 10393]. |
| | | |
− | $wgExtensionCredits['other'][] = array(
| + | * Using {{Tag|jmolAppletButton}} or {{Tag|jmolAppletlink}} throws an error in Internet Explorer: "Invalid argument", and prevents the pop-up. |
− | 'name' => 'Jmol Development Extension for MediaWiki',
| + | : '''Partially fixed''' (2008-Dec-2) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ revision 10411]. |
− | 'description' => 'adds the possibility to include Jmol applets in MediaWiki.',
| + | : '''Completely fixed''' (2008-Dec-8) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ revision 10467]. |
− | 'author' => 'Nicolas Vervelle, Jmol Development Team',
| |
− | 'url' => 'http://wiki.jmol.org/index.php/MediaWiki'
| |
− | );
| |
| | | |
− | function wfJmolDevExtension() {
| + | * The scripts associated to checkboxes rendered by {{tag|jmolCheckbox}} have no effect on the applet. |
− | global $wgParser;
| + | : '''Fixed''' (2008-Dec-8) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ revision 10467]. |
− | $wgParser->setHook( "jmolDev", "wfRenderJmolDev" );
| + | :: This was the discussion of the problem: |
− | }
| + | <div style="border:1px dashed #000099; margin-left:6ex;"> |
| + | (Bob) something in {{file|/skins/common/wikibits.js?97}} is disabling checkboxes.<br /> |
| + | (Nico) Yes, good catch, thanks a lot. Now, I need to find a way to overcome the behaviour of <code>setupCheckboxShiftClick()</code>. I am going to ask on mediawiki list.<br /> |
| + | (Bugzilla) [https://bugzilla.wikimedia.org/show_bug.cgi?id=10642 discussion] |
| + | </div> |
| + | :: The problem was due to a conflict in the <code>onClick</code> event for checkboxes correctly written by the Jmol Extension and a javascript library ({{file|wikibits.js}}) included in MediaWiki. The offending js function is now overwritten by the extension. |
| | | |
− | function wfRenderJmolDev($input) {
| + | * 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 [[User:Ilmari_Karonen/JS_injection_demo | 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 <code>javascript</code> command in Jmol scripts run from the MediaWiki Extension. |
− | global $wgJmolDevExtension;
| + | : '''Fixed''' (2008-Dec-8) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ revision 10467]. |
− | return $wgJmolDevExtension->renderJmol($input);
| + | :: 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 (<code>$wgJmolAuthorizeChoosingSignedApplet=true</code>) and requested for the applet (<code><signed>true</signed></code>). |
− | ?></pre>
| + | : '''Fixed''' (2008-Dec-8) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ 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 {{tag|urlContents}} tag and the url contains the '&' character. |
| + | : '''Fixed''' (2009-Nov-13) in [http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/ 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 {{tag|urlContents}} tag. The Extension will later filter those %26 codes and convert them to & so that the server correctly provides the model. |
| | | |
| = External links = | | = External links = |
Line 829: |
Line 92: |
| * Wikipedia: [[wikipedia:Wikipedia:Using Jmol to display molecular models|Using Jmol to display molecular models]] | | * Wikipedia: [[wikipedia:Wikipedia:Using Jmol to display molecular models|Using Jmol to display molecular models]] |
| * Wikipedia: [[wikipedia:Wikipedia:WikiProject Chemistry|WikiProject Chemistry]] | | * Wikipedia: [[wikipedia:Wikipedia:WikiProject Chemistry|WikiProject Chemistry]] |
| + | * MediaWiki: [http://www.mediawiki.org/wiki/Extension:Jmol Jmol Extension for MediaWiki] |