Difference between revisions of "Jmol testpage"

From NMReDATA
Jump to: navigation, search
(mime.types file)
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
 +
 
Note that I could not find a  
 
Note that I could not find a  
 
<code>includes/mime.types</code> file in main wiki folder ...
 
<code>includes/mime.types</code> file in main wiki folder ...
Line 17: Line 19:
 
<jmolFile>Chair.cml</jmolFile>
 
<jmolFile>Chair.cml</jmolFile>
 
</nowiki></code>
 
</nowiki></code>
== this does not work ==
+
== this also works... ==
<code><nowiki>
+
 
 
<jmol>
 
<jmol>
 
   <jmolApplet>
 
   <jmolApplet>
     <uploadedFileContents> Chair.cml </uploadedFileContents>
+
     <uploadedFileContents>Chair.cml</uploadedFileContents>
 
   </jmolApplet>
 
   </jmolApplet>
 
</jmol>
 
</jmol>
</nowiki></code>
 
 
 
 
<code><nowiki>
 
<code><nowiki>
 
<jmol>
 
<jmol>
 
   <jmolApplet>
 
   <jmolApplet>
     <wikiPageContents> toto </wikiPageContents>
+
     <uploadedFileContents>Chair.cml</uploadedFileContents>
 
   </jmolApplet>
 
   </jmolApplet>
 
</jmol>
 
</jmol>
 
</nowiki></code>
 
</nowiki></code>
 
+
== this also works... ==
 
 
There should be something here below:
 
<nowiki><code>
 
 
<jmol>
 
<jmol>
 
   <jmolApplet>
 
   <jmolApplet>
     <inlineContents>  
+
    <name>C</name>
 +
    <color>lightGray</color>
 +
    <size>400</size>
 +
    <caption>demo - note: needs at least one char on first line of inline content</caption>
 +
     <inlineContents>
 +
Menthol
 
OpenBabel02151916433D
 
OpenBabel02151916433D
  
Line 107: Line 108:
 
  11 31  1  0  0  0  0
 
  11 31  1  0  0  0  0
 
M  END
 
M  END
    </inlineContents>
+
    </inlineContents>
 +
  </jmolApplet>
 +
 
 +
  <jmolButton>
 +
    <script> spacefill on </script>
 +
    <text> spacefill </text>
 +
    <target> C </target>
 +
  </jmolButton>
 +
 
 +
  <jmolLink>
 +
    <script> spacefill 2% </script>
 +
    <text> ball and stick </text>
 +
    <target> C </target>
 +
  </jmolLink>
 +
 
 +
  <jmolCheckbox>
 +
    <scriptWhenChecked> spin on </scriptWhenChecked>
 +
    <scriptWhenUnchecked> spin off </scriptWhenUnchecked>
 +
    <checked> false </checked>
 +
    <text> spin </text>
 +
    <target> C </target>
 +
  </jmolCheckbox>
 +
 
 +
  <jmolMenu>
 +
    <target> C </target>
 +
    <item>
 +
      <text> color CPK </text>
 +
      <checked> true </checked>
 +
      <script> color cpk </script>
 +
    </item>
 +
    <item>
 +
      <text> blue </text>
 +
      <script> color dodgerBlue </script>
 +
    </item>
 +
    <item>
 +
      <text> green </text>
 +
      <script> color green </script>
 +
    </item>
 +
  </jmolMenu>
 +
 
 +
  <jmolRadioGroup>
 +
    <target> C </target>
 +
    <vertical>false</vertical>
 +
    <item>
 +
      <text> color CPK </text>
 +
      <checked> true </checked>
 +
      <script> color cpk </script>
 +
    </item>
 +
    <item>
 +
      <text> blue </text>
 +
      <script> color dodgerBlue </script>
 +
    </item>
 +
    <item>
 +
      <text> green </text>
 +
      <script> color green  </script>
 +
    </item>
 +
  </jmolRadioGroup>
 +
</jmol>
 +
 
 +
== Using script ==
 +
<jmol>
 +
 
 +
  <jmolApplet>
 +
    <name>A</name>
 +
    <title>This box might hold a 3D model</title>
 +
    <color>blueTint</color>
 +
    <size>500</size>
 +
    <script> echo Hi there! </script>
 +
  </jmolApplet>
 +
</jmol>
 +
 
 +
 
 +
<nowiki>
 +
<jmol>
 +
  <jmolApplet>
 +
    <name>A</name>
 +
    <title>This box might hold a 3D model</title>
 +
    <color>blueTint</color>
 +
    <size>500</size>
 +
    <script> echo Hi there! </script>
 +
  </jmolApplet>
 +
</jmol></nowiki>
 +
 
 +
</tr>
 +
 
 +
== Using urlContents ==
 +
<jmol>
 +
  <jmolApplet>
 +
    <name>B</name>
 +
    <title>A file retrieved from the PDB</title>
 +
    <caption>Murine adipocyte lipid binding protein at pH 4.5 (1AB0.pdb)</caption>
 +
    <color>blueTint</color>
 +
    <size>300</size>
 +
    <urlContents> https://files.rcsb.org/download/1ab0.pdb.gz </urlContents>
 +
    <pspeed>2</pspeed>
 +
    <controls>spin popup</controls>  
 
   </jmolApplet>
 
   </jmolApplet>
 
</jmol>
 
</jmol>
</nowiki></code>
 

Latest revision as of 09:24, 4 March 2019


Note that I could not find a includes/mime.types file in main wiki folder ...

Newer MW versions locate that in includes/libs/mime/mime.types

I may be related: I could not manage to allow the upload of .sdf .mol . But .cml files works (I followed these instructions)

this works

aspirin

<jmolSmiles>aspirin</jmolSmiles>

Chair.cml

<jmolFile>Chair.cml</jmolFile>

this also works...

<jmol> <jmolApplet> <uploadedFileContents>Chair.cml</uploadedFileContents> </jmolApplet> </jmol>

this also works...

demo - note: needs at least one char on first line of inline content

Using script

This box might hold a 3D model


<jmol>
  <jmolApplet>
    <name>A</name> 
    <title>This box might hold a 3D model</title> 
    <color>blueTint</color> 
    <size>500</size> 
    <script> echo Hi there! </script>
  </jmolApplet>
</jmol>

</tr>

Using urlContents

A file retrieved from the PDB

Murine adipocyte lipid binding protein at pH 4.5 (1AB0.pdb)