Template:Checkbox hide unhide: Difference between revisions

From Proteopedia
Jump to navigation Jump to search
Karsten Theis (talk | contribs)
No edit summary
Karsten Theis (talk | contribs)
No edit summary
Line 2: Line 2:
This template is to make a checkbox that hides an object of a scene when unchecked, and displays them again when checked. The checkbox is checked by default, so it makes sense if the object is visible in the scene. To use the template, include the following in your Proteopedia text:
This template is to make a checkbox that hides an object of a scene when unchecked, and displays them again when checked. The checkbox is checked by default, so it makes sense if the object is visible in the scene. To use the template, include the following in your Proteopedia text:
  <nowiki>
  <nowiki>
{{Checkbox hide unhide|Name="ATP molecule"|Selection="ATP"}}
{{Checkbox hide unhide|Name="ATP molecule"|Selection="ATP"}}</nowiki>
</nowiki>
In that spot, a checkbox will appear.  
In that spot, a checkbox will appear. Under the hood, the following Wikimedia/Jmol script is inserted:
<jmol>
  <jmolCheckbox>
    <scriptWhenChecked>display displayed or ATP}</scriptWhenChecked>
    <scriptWhenUnchecked>hide ATP or hidden</scriptWhenUnchecked>
    <checked>true</checked>
    <text>ATP molecule</text>
  </jmolCheckbox>
</jmol>
 
Under the hood, the following Wikimedia/Jmol script is inserted:
  <nowiki>
  <nowiki>
{{Checkbox hide unhide|Name|Selection}}
</nowiki>
&lt;jmol&gt;
&lt;jmol&gt;
   &lt;jmolCheckbox&gt;
   &lt;jmolCheckbox&gt;
Line 15: Line 22:
     &lt;text&gt;{{{Selection}}}&lt;/text&gt;
     &lt;text&gt;{{{Selection}}}&lt;/text&gt;
   &lt;/jmolCheckbox&gt;
   &lt;/jmolCheckbox&gt;
&lt;/jmol&gt;</noinclude>
&lt;/jmol&gt;
</nowiki>
</noinclude>
<jmol>
<jmol>
   <jmolCheckbox>
   <jmolCheckbox>

Revision as of 17:48, 29 August 2018

This template is to make a checkbox that hides an object of a scene when unchecked, and displays them again when checked. The checkbox is checked by default, so it makes sense if the object is visible in the scene. To use the template, include the following in your Proteopedia text:

{{Checkbox hide unhide|Name="ATP molecule"|Selection="ATP"}}

In that spot, a checkbox will appear.

Under the hood, the following Wikimedia/Jmol script is inserted:

<jmol>
  <jmolCheckbox>
    <scriptWhenChecked>display displayed or {{{Selection}}}</scriptWhenChecked>
    <scriptWhenUnchecked>hide {{{Selection}}} or hidden</scriptWhenUnchecked>
    <checked>true</checked> 
    <text>{{{Selection}}}</text>
  </jmolCheckbox>
</jmol>