Difference between revisions of "Template:Fit-image"
(Created page with "<includeonly><!-- --><templatestyles src="Fit-image/style.css" /><!-- -->{{#if: {{#var: fit-mode }} ||{{#vardefine: fit-mode | cover }} }}<!-- -->{{#if: {{{模式|{{{mode|}}}...") |
(Translated text (by SublimeText.Mediawiker)) |
||
Line 3: | Line 3: | ||
-->{{#if: {{#var: fit-mode }} ||{{#vardefine: fit-mode | cover }} }}<!-- | -->{{#if: {{#var: fit-mode }} ||{{#vardefine: fit-mode | cover }} }}<!-- | ||
− | -->{{#if: | + | -->{{#if: {{{mode|}}} | {{#vardefine: fit-mode | {{{mode|}}} }} |}}<!-- |
− | -->{{#if: | + | -->{{#if: {{{width|}}} | {{#vardefine: fit-width | {{{width|}}} }} |}}<!-- |
− | -->{{#if: | + | -->{{#if: {{{height|}}} | {{#vardefine: fit-height | {{{height|}}} }} |}}<!-- |
− | -->{{#vardefine: fit-outer | {{#expr: {{#switch: | + | -->{{#vardefine: fit-outer | {{#expr: {{#switch: external link | {{{2|}}} | {{{3|}}} | {{{4|}}} | {{{5|}}} = 1 | #default = 0 }} or {{#switch: external image | {{{2|}}} | {{{3|}}} | {{{4|}}} | {{{5|}}} = 1 | #default = 0 }} or {{#switch: extimage | {{{2|}}} | {{{3|}}} | {{{4|}}} | {{{5|}}} = 1 | #default = 0 }} }} }}<!-- |
− | -->{{#vardefine: fit-outer-link | {{#expr: {{#switch: | + | -->{{#vardefine: fit-outer-link | {{#expr: {{#switch: external link | {{{2|}}} | {{{3|}}} | {{{4|}}} | {{{5|}}} = 1 | #default = 0 }} or {{#switch: extlink | {{{2|}}} | {{{3|}}} | {{{4|}}} | {{{5|}}} = 1 | #default = 0 }} }} }}<!-- |
− | --><!-- | + | --><!--Declaring variables |
--><div class="fit-image {{{class|}}}" id="{{{id|}}}" | --><div class="fit-image {{{class|}}}" id="{{{id|}}}" | ||
Line 22: | Line 22: | ||
--><div class="fit-image-{{#var: fit-mode }}" style="width: {{#var: fit-width}}; height: {{#var: fit-height}};"><!-- | --><div class="fit-image-{{#var: fit-mode }}" style="width: {{#var: fit-width}}; height: {{#var: fit-height}};"><!-- | ||
-->{{#ifeq: {{#var: fit-outer }} | 1 | -->{{#ifeq: {{#var: fit-outer }} | 1 | ||
− | |<img alt="{{{1|}}}" src="{{path|{{{1|}}}}}"/>{{#ifeq: {{path|{{{1|}}}}} | {{filepath:{{{1|}}}}} |<div style="display: none;">[[file:{{{1|}}}]]</div>|}}<!-- | + | |<img alt="{{{1|}}}" src="{{path|{{{1|}}}}}"/>{{#ifeq: {{path|{{{1|}}}}} | {{filepath:{{{1|}}}}} |<div style="display: none;">[[file:{{{1|}}}]]</div>|}}<!--Here are hidden images that are guaranteed to be linked when using external images to call internal images--> |
|[[file:{{{1|}}}{{#if: {{#var: fit-height}} |{{!}}x{{#var: fit-height}}}}{{#if: {{#var: fit-width}} |{{!}}{{#var: fit-width}}}}{{#ifeq: {{{link|0}}} | 0 ||{{!}}link={{{link|}}}|}}]] | |[[file:{{{1|}}}{{#if: {{#var: fit-height}} |{{!}}x{{#var: fit-height}}}}{{#if: {{#var: fit-width}} |{{!}}{{#var: fit-width}}}}{{#ifeq: {{{link|0}}} | 0 ||{{!}}link={{{link|}}}|}}]] | ||
}}<!-- | }}<!-- | ||
--></div><!-- | --></div><!-- | ||
− | --><!-- | + | --><!--Image body |
-->{{#ifexpr: {{#if: {{{link|}}} |1|0}} and {{#var: fit-outer }} | | -->{{#ifexpr: {{#if: {{{link|}}} |1|0}} and {{#var: fit-outer }} | | ||
Line 32: | Line 32: | ||
-->{{#ifeq:{{#var: fit-outer-link}}|1|[{{{link|}}}]|[[{{{link|}}}]]}}<!-- | -->{{#ifeq:{{#var: fit-outer-link}}|1|[{{{link|}}}]|[[{{{link|}}}]]}}<!-- | ||
--></div><!-- | --></div><!-- | ||
− | -->|}}<!-- | + | -->|}}<!--Mask when using external images |
--></div><!-- | --></div><!-- | ||
Line 38: | Line 38: | ||
--></includeonly><!-- | --></includeonly><!-- | ||
− | --><noinclude>{{doc}}[[Category:Image templates]][[ | + | --><noinclude>{{doc}}[[Category:Image templates]][[Category:Templates using template styles]]</noinclude> |