Difference between revisions of "Template:SwitchPreview2"

From Math Images
Jump to: navigation, search
 
Line 1: Line 1:
<includeonly><span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="display:none;">'''<div class="hideshow"><center>[{{{ShowMessage}}}]</center></div>'''</span><div class="_toggle_initshow _toggle toggle-visible">{{#tag:preview|{{{PreviewText}}}| nc="{{{NumChars}}}" }}</div><span class="_toggle_inithide _toggle _toggler toggle-hidden" style="display:none;">'''<div class="hideshow"><center>[{{{HideMessage}}}]</center></div>'''</span><div class="_toggle_inithide _toggle toggle-hidden">{{{FullText}}}</div></includeonly>
+
<includeonly><span class="_togglegroup _toggle_initshow _toggle _toggler toggle-visible" style="display:none;">'''<div class="hideshow"><center>[{{{ShowMessage}}}]</center></div>'''</span><div class="_toggle_initshow _toggle toggle-visible">{{#tag:preview|{{{PreviewText}}}| nc="{{{NumChars}}}" }}</div><span class="_toggle_inithide _toggle _toggler toggle-hidden" style="display:none;">'''<div class="hideshow"><center>[{{{HideMessage}}}]</center></div>'''</span><div class="_toggle_inithide _toggle toggle-hidden">
 +
{{{FullText}}}
 +
</div></includeonly>
  
 
<noinclude>
 
<noinclude>

Latest revision as of 10:36, 20 July 2010


Usage

{{SwitchPreview2|ShowMessage=Click to expand|HideMessage=Click to hide|PreviewText=Hello, you are not viewing the totally expanded version|FullText=Hello, you are now viewing the expanded version.|NumChars=50}} 

This produces:

Hello, you are not viewing the totally expanded ver [...]

Hello, you are now viewing the expanded version.


This may be the only real way to deal with Math in the preview, since math is rendered before extensions can do anything with them. Thus if you would like to include math:

{{SwitchPreview2|ShowMessage=Click to expand|HideMessage=Click to hide|PreviewText=Hi there, this is a sample <math>{\color{Gray}a^2+b^2 = c^2}</math> equation. I might follow it with a proof. Maybe.|FullText=Hi there, this is a sample <math>{a^2+b^2 = c^2}</math> equation. I might follow it with a proof. Maybe.|NumChars=75}}

Hi there, this is a sample {\color{Gray}a^2+b^2 = c^2} equation. I migh [...]

Hi there, this is a sample {a^2+b^2 = c^2} equation. I might follow it with a proof. Maybe.