Template:Dump: Difference between revisions

Jump to navigation Jump to search
Want an adless experience? Log in or Create an account.
There's probably a much better way to do this
(optimized loops, made code ugly. note to self: use sub-templates to reduce code duplication.)
(There's probably a much better way to do this)
Line 4: Line 4:
     | {{#vardefine:first|{{#explode:{{#var:slashquote}}|-|0}}}}{{#vardefine:last|{{#explode:{{#var:slashquote}}|-|1}}}}<!--
     | {{#vardefine:first|{{#explode:{{#var:slashquote}}|-|0}}}}{{#vardefine:last|{{#explode:{{#var:slashquote}}|-|1}}}}<!--
   -->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}}
   -->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}}
       | {{#if: {{#var:usedelim}}
       | {{Dump/Display|{{{1}}}|{{#var:qid}}|qdelim={{{qdelim|{{S}}}}}|ldelim={{{ldelim|{{S}}}}}}}
        | {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}}
        | {{#vardefine:usedelim|true}}
        }}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{#var:qid}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}}
       }}
       }}
     | {{#if: {{#var:usedelim}}
     | {{Dump/Display|{{{1}}}|{{#var:slashquote}}|qdelim={{{qdelim|{{S}}}}}|ldelim={{{ldelim|{{S}}}}}}}
      | {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}}
      | {{#vardefine:usedelim|true}}
      }}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{#var:slashquote}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}}
     }}
     }}
   }}
   }}
Line 18: Line 12:
   | {{#vardefine:first|{{#explode:{{{2|}}}|-|0}}}}{{#vardefine:last|{{#explode:{{{2|}}}|-|1}}}}<!--
   | {{#vardefine:first|{{#explode:{{{2|}}}|-|0}}}}{{#vardefine:last|{{#explode:{{{2|}}}|-|1}}}}<!--
  -->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}}
  -->{{#loop: qid | {{#var:first}} | {{#expr:{{!!=|last|{{#var:first}}}}-{{#var:first}}+1}}
     | {{#if: {{#var:usedelim}}
     | {{Dump/Display|{{{1}}}|{{#var:qid}}|qdelim={{{qdelim|{{S}}}}}|ldelim={{{ldelim|{{S}}}}}}}
      | {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}}
      | {{#vardefine:usedelim|true}}
      }}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{#var:qid}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}}
     }}
     }}
   | {{#if: {{#var:usedelim}}
   | {{Dump/Display|{{{1}}}|{{{2|}}}|qdelim={{{qdelim|{{S}}}}}|ldelim={{{ldelim|{{S}}}}}}}
    | {{!!=|dump-qdelim|{{{qdelim|{{S}}}}}}}
    | {{#vardefine:usedelim|true}}
    }}{{:{{Zelda|{{{1}}}}} Text Dump/Select|{{{2|}}}|{{!!=|dump-ldelim|{{{ldelim|{{S}}}}}}}}}
   }}
   }}
}}</onlyinclude>
}}</onlyinclude>

Navigation menu