Template:Checkbox hide unhide

From Proteopedia

(Difference between revisions)
Jump to: navigation, search
Current revision (09:59, 10 September 2020) (edit) (undo)
 
(7 intermediate revisions not shown.)
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"}}</nowiki>
+
{{Checkbox hide unhide|Name=ATP molecule|Selection=ATP}}</nowiki>
In that spot, a checkbox will appear.
In that spot, a checkbox will appear.
Line 21: Line 21:
&lt;scriptWhenUnchecked&gt;hide {{{Selection}}} or hidden&lt;/scriptWhenUnchecked&gt;
&lt;scriptWhenUnchecked&gt;hide {{{Selection}}} or hidden&lt;/scriptWhenUnchecked&gt;
&lt;checked&gt;true&lt;/checked&gt;
&lt;checked&gt;true&lt;/checked&gt;
-
&lt;text&gt;{{{Selection}}}&lt;/text&gt;
+
&lt;text&gt;{{{Name}}}&lt;/text&gt;
&lt;/jmolCheckbox&gt;
&lt;/jmolCheckbox&gt;
&lt;/jmol&gt;
&lt;/jmol&gt;
Line 27: Line 27:
</noinclude>
</noinclude>
<includeonly>
<includeonly>
-
{{#vardefine:myname|{{{Name}}} }}
 
<jmol>
<jmol>
<jmolCheckbox>
<jmolCheckbox>
Line 33: Line 32:
<scriptWhenUnchecked>hide {{{Selection|all}}} or hidden</scriptWhenUnchecked>
<scriptWhenUnchecked>hide {{{Selection|all}}} or hidden</scriptWhenUnchecked>
<checked>true</checked>
<checked>true</checked>
-
<text> {{#var:myame}} </text>
+
<text> {{{Name|Everything}}} </text>
</jmolCheckbox>
</jmolCheckbox>
</jmol>
</jmol>
-
</includeonly>
 
Troubleshooting:
Troubleshooting:
-
Name is: {{#var:myname}}
+
Named parameter Name: {{{Name|Everything}}}
-
First parameter: {{{1}}}
+
Named parameter Selection: {{{Selection|all}}}
-
Second parameter: {{{2}}}}
+
Named parameter Initial: {{{Initial|true}}}
-
 
+
</includeonly>
-
Third parameter: {{{3}}}
+
-
 
+
-
Named parameter Name: {{{Name}}}
+
-
 
+
-
Named parameter Selection: {{{Selection}}}
+

Current revision

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>{{{Name}}}</text>
  </jmolCheckbox>
</jmol>


Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis, Angel Herraez

Personal tools