User:Johan G/Messagebox: Difference between revisions

Jump to navigation Jump to search
m
Test for valid box type and style; etc
m (small fixes)
m (Test for valid box type and style; etc)
Line 1: Line 1:
{{#switch:  <!-- Is the box type and box style parameters valid? (Show stopper)
-->{{#switch: {{{box|top}}}  <!-- Checking box type parameter -->
  | box
  | section
  | top =
 
  | #default =
  {{#if: {{{box-style|}}}  <!-- Was a custom box style used? -->
  |  <!-- Yes, ignore -->
  |  <!-- No, and the box type is not valid -->
  box not ok,
  }}
}}<!--
-->{{#switch: {{{style|notice}}}  <!-- Checking box style parameter -->
  | speedy
  | warning
  | caution
  | notice
  | tip
  | protected
  | neutral =
 
  | #default =
  {{#if: {{{box-style|}}}  <!-- Was a custom box style used? -->
  |  <!-- Yes, ignore -->
  |  <!-- No, and the box style is not valid -->
  style not ok
  }}
}}
| box not ok, =
invalid box type!
| style not ok =
invalid box style!
| box not ok,style not ok =
box type and style invalid!
| #default =
box type and style valid
}}
{| class="wikitable"  <!-- Begin box -->  
{| class="wikitable"  <!-- Begin box -->  
|
|
Line 12: Line 53:
   top
   top
   |  <!-- No, an invalid type of box is specified -->
   |  <!-- No, an invalid type of box is specified -->
   invalid box type
   invalid box type!
  }}
  }}
}};<!--
}};<!--
Line 34: Line 75:
   notice
   notice
   |  <!-- No, an invalid box style is specified -->
   |  <!-- No, an invalid box style is specified -->
   invalid box style
   invalid box style!
  }}
  }}
}};<!--
}};<!--
Line 70: Line 111:
     {{{image|image}}}
     {{{image|image}}}
     |  <!-- No the specified image does not exist -->
     |  <!-- No the specified image does not exist -->
     non-existent image
     non-existent image!
   }}
   }}
   }}
   }}
   |  <!-- No, an invalid custom image width was specified -->
   |  <!-- No, an invalid custom image width was specified -->
   custom image width not a number
   custom image width not a number!
  }}
  }}
  |  <!-- No there is no image -->
  |  <!-- No there is no image -->

Navigation menu