MediaWiki

From Jmol
Revision as of 10:47, 29 November 2007 by Anonymous (talk)
Jump to navigation Jump to search

carisoprodol online grasse verison wireless plan ghost whole house fan porno video free full length adult movies the best replica rolex watch spanish properties young joc scabies treatment wedding decoration addicts superman louis vuitton wallets free anal sex designer clothes human skeleton picture japanese translator flomax side effects hermaphrodite porn paris hilton sex movie roller shutters towable vehicles used audi parts scat basement remodeling wireless modem adipex online auto zone auto part 1st year aniversery gifts buy codeine home based business opportunities alprazolam free metro ringtones double penetration video valium xanax african food recipes nokia n71 motorcycle trike breast lift cash advance loan lady sonia torrent womens lee jean motorcycle for sale mp3 ringtone yellowstone national park dirt bike parts rent movie four star hotel in florence colleg wwe music free verizon wireless ringtone telecommunications boost mobile phone prepaid play houses military jobs common law marriage florida glycolax adult personal classifieds elementary schools excel tutorial infant jordan shoes football pictures journalism cholestyramine work from home photo sex download emule america west airline homemade sex toys liver disease satellite broadband mazda 3 bet music employment canada india porno retro handbags wholesale toyota dealer women seeking woman discovery baltimore aquarium homedepot medical alert bracelet wawanesa auto insurance preorder ps3 disney princes love making minnie mouse nipple piercings bontril online toys sex pricing anderson replacement windows joann fabrics coupons lil john online xxx dvd keflex 500mg pearson airport cheap disneyland tickets soccer pitbulls ear cropping meaning of anthropology translate russian web thrust celebrity groupies america association care lawn professional lemonade stand san antonio spurs jordan pussy samsung a670 autoclave anita blonde hardcore jewish single group male massage what is feminist movement to beat the child was bad enough include file not found discounted contact lens samson exhaust business hosting sexy mini skirt gallery hands up mcafee stinger young teens wearing thongs alexander brooks every little thing ako gigantic penis wood workshop ideas savings bank life insurance hot topless babes aventis sex movie adapter belkin usb leprosy under the kilt lexicon steel buildings construction for church ways of making money hair tips for curly hair little virgins exclusive nathalie naturist pictures casinos in indiana lolita video lindsay lohan breast slip one by one leadership fresno rocket modeler 2 t rowe price sound files html help quilt blocks transexuals cheap zocor free mobile phone mp3 ringtone drunk teen sex ameriplan texas land for sale piroxicam brazil people discount adipex london 2012 spanking blog schoolgirls upskirt gallery ball lightning dance paintings really long foreskins new homes in colorado springs marlene beautiful naked woman amalfi coast charlotte ross nude mary kate ashley fucking free bbw movies buy alprazolam honeymoon cruises bulk email psp wireless internet olsen twins sex free adult comics florida parkinsons disease law suit lawyers graphic organizers renault kangoo shoulder pain free xxx story become an isp top heavy nancys perky breast mature model teen sex model target pharmacy incest bbs wwf sleeping teens celebrity movie cp lolita ivillage big boobed teens lyric power song station free website hosting english to latin

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 Jmol applet inside of Mediawiki pages. This simple page demonstrates how to use the extension.

Current status: 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 Jmol applets and controls.

Simple usage

Jmol applet in a MediaWiki page

To add a Jmol applet to a MediaWiki page, just add the following:

<jmol>
  <jmolApplet>
    <uploadedFileContents>file uploaded in the wiki containing the molecular data</uploadedFileContents>
  </jmolApplet>
</jmol>

or

<jmol>
  <jmolApplet>
    <wikiPageContents>page of the wiki containing the molecular data</wikiPageContents>
  </jmolApplet>
</jmol>

or

<jmol>
  <jmolApplet>
    <inlineContents>contents of the molecular file</inlineContents>
  </jmolApplet>
</jmol>

or

<jmol>
  <jmolApplet>
    <urlContents>URL of the molecular file</urlContents>
  </jmolApplet>
</jmol>

Controls for the Jmol applet

To add buttons to send scripts to the applet, just add the following:

<jmol>
  <jmolButton>
    <script>script to execute</script>
    <text>text of the button</text>
  </jmolButton>
</jmol>

To add links to send scripts to the applet, just add the following:

<jmol>
  <jmolLink>
    <script>script to execute</script>
    <text>text of the link</text>
  </jmolLink>
</jmol>

To add checkboxes to send scripts to the applet, just add the following:

<jmol>
  <jmolCheckbox>
    <scriptWhenChecked>script to execute when the checkbox is checked</scriptWhenChecked>
    <scriptWhenUnchecked>script to execute when the checkbox is unchecked</scriptWhenUnchecked>
    <text>text of the checkbox</text>
  </jmolCheckbox>
</jmol>

To add radio groups to send scripts to the applet, just add the following:

<jmol>
  <jmolRadioGroup>
    <item>
      <script>script to execute when the radio button is selected</script>
      <text>text of the radio button</text>
    </item>
    <item>
      <script>script to execute when the radio button is selected</script>
      <text>text of the radio button</text>
    </item>
  </jmolRadioGroup>
</jmol>

To add menus to send scripts to the applet, just add the following:

<jmol>
  <jmolMenu>
    <item>
      <script>script to execute when the menu item is selected</script>
      <text>text of the menu item</text>
    </item>
    <item>
      <script>script to execute when the menu item is selected</script>
      <text>text of the menu item</text>
    </item>
  </jmolMenu>
</jmol>

Applets and other controls can be combined in a single <jmol> tag.

Jmol applet in a popup window

To add a button that opens a new window with a Jmol applet, use the <JmolAppletButton> tag instead of the <JmolApplet> tag and also add the <text> tag in it. For example:

<jmol>
  <jmolAppletButton>
    <uploadedFileContents>file uploaded in the wiki containing the molecular data</uploadedFileContents>
    <text>text displayed in the button<text>
  </jmolAppletButton>
</jmol>

To add a link that opens a new window with a Jmol applet, use the <JmolAppletLink> tag instead of the <JmolApplet> tag and also add the <text> tag in it. For example:

<jmol>
  <jmolAppletLink>
    <uploadedFileContents>file uploaded in the wiki containing the molecular data</uploadedFileContents>
    <text>text displayed in the link<text>
  </jmolAppletLink>
</jmol>

Reference

The <jmol> tag can contain the following:

  • <jmolApplet> : Jmol Applet.
    • <signed> (true, false) : 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 $wgJmolAuthorizeChoosingSignedApplet setting in File icon.gifLocalSettings.php.
    • <color> : To change the background color of the Jmol applet.
    • <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 $wgFileExtensions in File icon.gifLocalSettings.php). This attribute can be disabled by the Wiki administrator with the $wgJmolAuthorizeUploadedFile setting in File icon.gifLocalSettings.php.
    • <wikiPageContents> : Name of a page of this wiki containing the molecular data to load in the Jmol applet.
    • <urlContents> : URL of the molecular file to load. This attribute can be disabled by the Wiki administrator with the $wgJmolAuthorizeUrl setting in File icon.gifLocalSettings.php.
    • <inlineContents> : Molecular data to load in the Jmol applet.
    • <size> : Size of the applet.
    • <script> : Script to execute at startup.
    • <name> : Name of the Jmol applet (useful if you want to use several Jmol applets in the same page).
  • <jmolButton> : Button.
    • <script> : Jmol script to execute when the button is clicked.
    • <text> : Text of the button.
    • <name> : Name of the button.
    • <target> : Name of the Jmol applet linked with the button (useful only if you want to use several Jmol applets in the same page).
  • <jmolLink> : Link. Same tags as <jmolButton>.
  • <jmolCheckbox> : Checkbox.
    • <scriptWhenChecked> : Jmol script to execute when the checkbox is checked.
    • <scriptWhenUnchecked> : Jmol script to execute when the checkbox is unchecked.
    • <checked> (true, false) : Indicates if the checkbox is checked by default.
    • <text> : Text of the button.
    • <name> : Name of the button.
    • <target> : Name of the Jmol applet linked with the button (useful only if you want to use several Jmol applets in the same page).
  • <jmolMenu> : Menu.
    • <item> : Menu item.
      • <script> : Jmol script to execute when the menu item is selected.
      • <text> : Text of the menu item.
      • <checked> (true, false) : Indicates if the menu item is checked.
    • <name> : Name of the menu.
    • <target> : Name of the Jmol applet linked with the menu (useful only if you want to use several Jmol applets in the same page).
    • <menuHeight> : Number of visible menu items (1: combo-box, 2 or greater: list with the specified number of lines, -1: calculated).
  • <jmolRadioGroup> : Radio group.
    • <item> : Radio button.
      • <script> : Jmol script to execute when the radio button is selected.
      • <text> : Text of the radio button.
      • <checked> (true, false) : Indicates if the radio button is checked.
    • <name> : Name of the radio group.
    • <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).
    • <vertical> (true, false) : Indicates if the radio buttons are stacked vertically or horizontally.
  • <jmolAppletButton> : A button for opening a new window with a Jmol Applet. It can contains the same tags as the <jmolApplet> tag, and also the following tags :
    • <text> : Text of the button.
    • <title> : Title of the new window (doesn't work for the moment).
    • <x> and <y> : Position of the new window.
  • <jmolAppletLink> : A link for opening a new window with a Jmol Applet. Same tags as <jmolAppletButton>.

Test Pages

  1. Uploaded XYZ File
  2. Uploaded MDL Molfile
  3. Uploaded CML File
  4. Inlined MDL Molfile
  5. Inlined CML File

Installation

Download Jmol and extract all the files in a temporary directory.

Create the directory Jmol in $mediawiki/extensions, and copy the following files in it:

  • File icon.gifCOPYRIGHT.txt
  • File icon.gifJmol.js
  • File icon.gifJmolApplet_i18n.jar and File icon.gifJmolApplet0.jar to File icon.gifJmolApplet6.jar
  • File icon.gifJmolAppletSigned_i18n.jar and File icon.gifJmolAppletSigned0.jar to File icon.gifJmolAppletSigned6.jar, if you want to be able to use the signed applet.
  • File icon.gifLICENSE.txt
  • File icon.gifREADME.txt


Add the following line to the end of File icon.gifLocalSettings.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):

  • $wgJmolAuthorizeChoosingSignedApplet (true, false) : Authorize users to choose between the unsigned and the signed Jmol applet.
  • $wgJmolAuthorizeUploadedFile (true, false) : Authorize the use of <uploadedFileContents>.
  • $wgJmolAuthorizeUrl (true, false) : Authorize the use of <urlContents>.
  • $wgJmolDefaultAppletSize (400) : Size in pixels of the Jmol applet.
  • $wgJmolDefaultScript : Default script.
  • $wgJmolExtensionPath : Path to the directory where the Jmol extension is installed.
  • $wgJmolForceNameSpace : Force the NameSpace where the applet will go looking for wiki pages containing molecular data (using <wikiPageContents>).
  • $wgJmolShowWarnings (true, false) : Display warnings when users try to use disabled features.
  • $wgJmolUsingSignedAppletByDefault (true, false) : 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.


Note: If you want to authorize users to upload files containing molecular data (for using the <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 icon.gif*.cml files, add $wgFileExtensions[] = 'cml'; in File icon.gifLocalSettings.php.
  • You can add an icon in the skins/common/images/icons/ directory for each extension (for example, File icon.giffileicon-cml.png). In this wiki, we are using this image, which leads to the following result.


External links