Modèle:Mbox

De DigiWiki.

(Différences entre les versions)
Ligne 1 : Ligne 1 :
-
<table id="{{{id|}}}" class="mbox mbox-wide
+
<table class="metadata plainlinks mbox {{#switch:{{{small|}}}
-
{{#switch:{{{type|}}}
+
| left = mbox-small-left
-
| warning    = mbox-warning
+
}} {{#switch:{{{type|}}}
-
| editnotice =  
+
| speedy    =
-
| system          <!-- system = default -->
+
| critical  = mbox-critical
-
| #default  = mbox-notice
+
| delete
-
}} {{{class|}}}" style="{{{style|}}}">
+
| important  = mbox-important
 +
| warning  
 +
| content   = mbox-warning
 +
| caution   
 +
| style      = mbox-caution
 +
| notice    = mbox-notice
 +
| move      = mbox-move
 +
| protection = mbox-protection
 +
| notice
 +
| license  = mbox-license
 +
| #default  = <!-- no type colours -->
 +
}}" style="{{{style|}}}">
<tr>
<tr>
-
{{#ifeq:{{{image|}}}|none
+
{{#switch:{{{image|}}}
-
| <td class="mbox-empty-cell"><!-- No image. --></td>
+
| none = <td class="mbox-empty-cell"></td>  <!-- No image. Cell with some width or padding necessary for text cell to have 100% width. -->
-
| <td class="mbox-image">
+
| #default =
 +
  <td class="mbox-image">{{
 +
  #switch:{{{small|}}}
 +
  | left = <!-- Don't use the DIV -->
 +
  | #default = <div style="width: {{{imagewidth||52px}}};">
 +
  }}
   {{#if:{{{image|}}}
   {{#if:{{{image|}}}
   | {{{image}}}
   | {{{image}}}
   | [[File:{{#switch:{{{type|}}}
   | [[File:{{#switch:{{{type|}}}
-
     | warning    = Cmbox deletion.png
+
    | critical  = Ambox speedy deletion.png
-
     | editnotice = Imbox notice.png
+
    | important  = Ambox deletion.png
-
     | system         <!-- system = default -->
+
     | warning    = Ambox content.png
-
     | #default  = Imbox notice.png
+
     | caution    = Edit-clear.svg
-
     }}|40x40px|link=|alt=]]
+
    | move      = Ambox move.png
 +
    | protection = Ambox protection.png
 +
    | license = Imbox license.png
 +
     | notice         <!-- notice = default -->
 +
     | #default  = Ambox notice.png
 +
     }} | {{#switch:{{{small|}}}
 +
      | left = 20x20px
 +
      | #default = 40x40px  
 +
      }} |link=|alt=]]
 +
  }}{{#switch:{{{small|}}}
 +
  | left = <!-- Don't use the /DIV -->
 +
  | #default = </div>
   }}</td>
   }}</td>
}}
}}
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
<td class="mbox-text" style="{{{textstyle|}}}"> {{{text}}} </td>
{{#if:{{{imageright|}}}
{{#if:{{{imageright|}}}
-
| <td class="mbox-imageright"> {{{imageright}}} </td>
+
| {{#ifeq:{{{imageright|}}}|none
 +
  | <!-- No image. -->
 +
  | <td class="mbox-imageright">{{#switch:{{{small|}}}
 +
    | left = {{{imageright}}}
 +
    | #default = <div style="width: {{{imagerightwidth|52px}}};"> {{{imageright}}} </div>
 +
    }}</td>
 +
  }}
}}
}}
</tr>
</tr>
-
</table><!--
+
</table>
-
  Detect and report usage with faulty "type" parameter:
+
-
-->{{#switch:{{{type|}}}
+
-
|  <!-- No type fed, is also valid input -->
+
-
| warning
+
-
| editnotice
+
-
| system    =    <!-- Do nothing, valid "type" -->
+
-
| #default  = <div style="text-align: center;">This message box is using an invalid "type={{{type|}}}" parameter and needs fixing.</div>[[Category:Wikipedia message box parameter needs fixing|{{main other|Main:}}{{FULLPAGENAME}}]]<!-- Sort on namespace -->
+
-
}}
+

Version du 21 janvier 2012 à 11:41

Outils personnels
donate
Google Ads