Difference between revisions of "Template:LSL Function"

From Second Life Wiki
Jump to navigation Jump to search
m (inherit func_id if not set, simplify logic, if they are null, no point in defining)
(More cleanup & template injection to aid in manipulation, etc (injection lets a template mooch some variables) inject-1 is before parameter setup, inject-2 is after.)
Line 1: Line 1:
{{Multi-lang|category=LSL}}{{LSL Header{{#var:lang}}}} __NOTOC__ <noinclude>
{{Multi-lang|category=LSL}}{{LSL Header{{#var:lang}}}} __NOTOC__ <noinclude>
See [[{{#var:langbase}}/docs{{#var:lang}}]] for documentation.
See [[{{#var:langbase}}/docs{{#var:lang}}]] for documentation.
</noinclude><includeonly>{{#if:{{#vardefine:sort|{{#if:{{#var:sort}}|{{#var:sort}}|{{{sort|}}}}}}}{{{{#if:{{#var:sort}}|!|LSL_Sort}}|}}}}<div id="sort" style="display:none">{{DEFAULTSORT:{{#var:sort}}}}{{#var:sort}}</div>{{#if:{{#var:nofixname}}||{{#if:{{#pos:{{lc:{{FULLPAGENAMEE}}}}|{{lc:{{{func}}}}}}}|<div id="RealTitleBanner" style="display:none"><span id="RealTitle">{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{{func}}}</span></div>}}}}{{#if:
</noinclude><includeonly>{{#if:{{#var:sort}}||{{#if:{{{sort|}}}|{{#vardefine:sort|{{{sort|}}}}}|{{#if:{{LSL_Sort}}}}}}}}<div id="sort" style="display:none">{{DEFAULTSORT:{{#var:sort}}}}{{#var:sort}}</div>{{#if:{{#var:nofixname}}||{{#if:{{#pos:{{lc:{{FULLPAGENAMEE}}}}|{{lc:{{{func}}}}}}}|<div id="RealTitleBanner" style="display:none"><span id="RealTitle">{{#if:{{NAMESPACE}}|{{NAMESPACE}}:}}{{{func}}}</span></div>}}}}{{#if:


{{#vardefine:article_type|function}}
{{#vardefine:article_type|function}}
Line 7: Line 7:
{{#vardefine:mode|{{#var:mode}}{{{mode|}}}}}
{{#vardefine:mode|{{#var:mode}}{{{mode|}}}}}
{{#vardefine:self|{{#var:self}}{{{self|}}}}}
{{#vardefine:self|{{#var:self}}{{{self|}}}}}
{{{inject-1|}}}


{{{{#switch:{{#var:mode}}
{{{{#switch:{{#var:mode}}
Line 13: Line 15:
|pre-release=LSL_Generic/pre-release{{#var:lang}}
|pre-release=LSL_Generic/pre-release{{#var:lang}}
|preview=LSL_Generic/preview{{#var:lang}}
|preview=LSL_Generic/preview{{#var:lang}}
|user=!{{#vardefine:moded|u{{#var:moded}}}}
|!}}|}}
|!}}|}}
{{{{#if:{{{deprecated|}}}|LSL_Generic/deprecated{{#var:lang}}|!}}|{{{deprecated|}}}|}}
{{{{#if:{{{deprecated|}}}|LSL_Generic/deprecated{{#var:lang}}|!}}|{{{deprecated|}}}|}}
{{#vardefine:PBR|{{#if:{{#var:header_desc}}{{{func_desc|}}}|{{PBR}}}}}}
{{#vardefine:header_desc|{{#var:header_desc}}{{#var:PBR}}
{{{func_desc|}}}{{#var:PBR}}}}
{{#vardefine:return_text|{{#var:return_text}}{{{return_text|}}}{{{Return_text|}}} }}


{{#vardefine:p_{{{p1_name|}}}_desc|{{#var:p_{{{p1_name|}}}_desc}}{{{p1_desc|}}}}}
{{#vardefine:p_{{{p1_name|}}}_desc|{{#var:p_{{{p1_name|}}}_desc}}{{{p1_desc|}}}}}
Line 47: Line 44:
{{#vardefine:p_{{{p12_name|}}}_hover|{{#var:p_{{{p12_name|}}}_hover}}{{{p12_hover|}}}}}
{{#vardefine:p_{{{p12_name|}}}_hover|{{#var:p_{{{p12_name|}}}_hover}}{{{p12_hover|}}}}}


{{#vardefine:PBR|{{#if:{{#var:header_footnote}}{{{func_footnote|}}}{{{func_footer|}}}|{{PBR}}}}}}
{{{inject-2|}}}
{{#vardefine:header_footnote|{{#var:header_footnote}}{{#var:PBR}}
 
{{{func_footnote|}}}{{#var:PBR}}
{{#if:{{#var:header_desc}}{{{func_desc|}}}|
{{{func_footer|}}}{{#var:PBR}}}}
{{#vardefine:header_desc|{{#var:header_desc}}{{PBR}}
{{{func_desc|}}}{{PBR}}}}
}}
 
{{#vardefine:return_text|{{#var:return_text}}{{{return_text|}}}{{{Return_text|}}} }}
 
{{#if:{{#var:header_footnote}}{{{func_footnote|}}}{{{func_footer|}}}|
{{#vardefine:header_footnote|{{#var:header_footnote}}{{PBR}}
{{{func_footnote|}}}{{PBR}}
{{{func_footer|}}}{{PBR}}}}
}}


{{#if:{{#var:newbie}}||
{{#if:{{#var:newbie}}||
Line 72: Line 79:
{{#var:caveats}}}}{{#if:{{{caveats|}}}|
{{#var:caveats}}}}{{#if:{{{caveats|}}}|
{{{caveats|}}}}}
{{{caveats|}}}}}
{{#ifeq:{{#var:mode}}|user||{{#if:{{#var:bugs}}|<h3 style="display:inline; line-height:2em;">Important Issues </h3>~ {{JiraSearch/1|1={{{keywords|}}} {{{func}}}|2=Search JIRA for related Bugs}}
{{#if:{{#pos:{{#var:moded}}|u}}||{{#if:{{#var:bugs}}|<h3 style="display:inline; line-height:2em;">Important Issues </h3>~ {{JiraSearch/1|1={{{keywords|}}} {{{func}}}|2=Search JIRA for related Bugs}}
{{{!}} style="font-size:80%; line-height:1.1em;"  
{{{!}} style="font-size:80%; line-height:1.1em;"  
{{#var:bugs}}
{{#var:bugs}}
Line 160: Line 167:


}}{{#if:{{#var:self}}|| __NOEDITSECTION__
}}{{#if:{{#var:self}}|| __NOEDITSECTION__
}}{{#var:header}}{{#if:{{#var:func_id}}{{#var:mode}}||
}}{{#var:header}}{{#if:{{#var:func_id}}{{#var:mode}}{{#var:moded}}||
<div id="box" style="background:red;">
<div id="box" style="background:red;">
&nbsp;&nbsp;'''Don't delete the 'func_id''''
&nbsp;&nbsp;'''Don't delete the 'func_id''''
Line 174: Line 181:
desc none
desc none
}}</div>}}<span id="{{anchorencode:Description}}" style="display:none"></span><span id="{{anchorencode:Summary}}" class="mw-headline" style="display:block; padding-bottom:0.17em; padding-top:0.5em; background:transparent none repeat scroll 0% 0%; color:#546368; font-family:Arial,Helvetica,Sans-Serif; background-color:#F4F8FB; border-bottom:1px dotted #AAAAAA; font-size:120%; font-weight:bold; margin:0pt; padding:0.2em 0.5em; text-align:left;"> [[:Category:LSL_Functions{{#var:lang}}|Function]]: {{#if:{{{return_type|}}}|[[{{{return_type|}}}{{#var:lang}}|{{{return_type|}}}]]||}} [[{{{func}}}{{#var:lang}}|{{{func}}}]]( {{#if:{{{p1_name|}}}{{{p1_type|}}}| [[{{{p1_type|}}}{{#var:lang}}|{{{p1_type|}}}]] {{LSL Param|{{{p1_name|}}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|, [[{{{p2_type|}}}{{#var:lang}}|{{{p2_type|}}}]] {{LSL Param|{{{p2_name|}}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|, [[{{{p3_type|}}}{{#var:lang}}|{{{p3_type|}}}]] {{LSL Param|{{{p3_name|}}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|, [[{{{p4_type|}}}{{#var:lang}}|{{{p4_type|}}}]] {{LSL Param|{{{p4_name|}}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|, [[{{{p5_type|}}}{{#var:lang}}|{{{p5_type|}}}]] {{LSL Param|{{{p5_name|}}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|, [[{{{p6_type|}}}{{#var:lang}}|{{{p6_type|}}}]] {{LSL Param|{{{p6_name|}}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|, [[{{{p7_type|}}}{{#var:lang}}|{{{p7_type|}}}]] {{LSL Param|{{{p7_name|}}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|, [[{{{p8_type|}}}{{#var:lang}}|{{{p8_type|}}}]] {{LSL Param|{{{p8_name|}}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|, [[{{{p9_type|}}}{{#var:lang}}|{{{p9_type|}}}]] {{LSL Param|{{{p9_name|}}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|, [[{{{p10_type|}}}{{#var:lang}}|{{{p10_type|}}}]] {{LSL Param|{{{p10_name|}}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|, [[{{{p11_type|}}}{{#var:lang}}|{{{p11_type|}}}]] {{LSL Param|{{{p11_name|}}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|, [[{{{p12_type|}}}{{#var:lang}}|{{{p12_type|}}}]] {{LSL Param|{{{p12_name|}}}}}}}}}}}}}}}}}}}}}}}}}}}}} )<nowiki>;</nowiki></span>
}}</div>}}<span id="{{anchorencode:Description}}" style="display:none"></span><span id="{{anchorencode:Summary}}" class="mw-headline" style="display:block; padding-bottom:0.17em; padding-top:0.5em; background:transparent none repeat scroll 0% 0%; color:#546368; font-family:Arial,Helvetica,Sans-Serif; background-color:#F4F8FB; border-bottom:1px dotted #AAAAAA; font-size:120%; font-weight:bold; margin:0pt; padding:0.2em 0.5em; text-align:left;"> [[:Category:LSL_Functions{{#var:lang}}|Function]]: {{#if:{{{return_type|}}}|[[{{{return_type|}}}{{#var:lang}}|{{{return_type|}}}]]||}} [[{{{func}}}{{#var:lang}}|{{{func}}}]]( {{#if:{{{p1_name|}}}{{{p1_type|}}}| [[{{{p1_type|}}}{{#var:lang}}|{{{p1_type|}}}]] {{LSL Param|{{{p1_name|}}}}}{{#if:{{{p2_name|}}}{{{p2_type|}}}|, [[{{{p2_type|}}}{{#var:lang}}|{{{p2_type|}}}]] {{LSL Param|{{{p2_name|}}}}}{{#if:{{{p3_name|}}}{{{p3_type|}}}|, [[{{{p3_type|}}}{{#var:lang}}|{{{p3_type|}}}]] {{LSL Param|{{{p3_name|}}}}}{{#if:{{{p4_name|}}}{{{p4_type|}}}|, [[{{{p4_type|}}}{{#var:lang}}|{{{p4_type|}}}]] {{LSL Param|{{{p4_name|}}}}}{{#if:{{{p5_name|}}}{{{p5_type|}}}|, [[{{{p5_type|}}}{{#var:lang}}|{{{p5_type|}}}]] {{LSL Param|{{{p5_name|}}}}}{{#if:{{{p6_name|}}}{{{p6_type|}}}|, [[{{{p6_type|}}}{{#var:lang}}|{{{p6_type|}}}]] {{LSL Param|{{{p6_name|}}}}}{{#if:{{{p7_name|}}}{{{p7_type|}}}|, [[{{{p7_type|}}}{{#var:lang}}|{{{p7_type|}}}]] {{LSL Param|{{{p7_name|}}}}}{{#if:{{{p8_name|}}}{{{p8_type|}}}|, [[{{{p8_type|}}}{{#var:lang}}|{{{p8_type|}}}]] {{LSL Param|{{{p8_name|}}}}}{{#if:{{{p9_name|}}}{{{p9_type|}}}|, [[{{{p9_type|}}}{{#var:lang}}|{{{p9_type|}}}]] {{LSL Param|{{{p9_name|}}}}}{{#if:{{{p10_name|}}}{{{p10_type|}}}|, [[{{{p10_type|}}}{{#var:lang}}|{{{p10_type|}}}]] {{LSL Param|{{{p10_name|}}}}}{{#if:{{{p11_name|}}}{{{p11_type|}}}|, [[{{{p11_type|}}}{{#var:lang}}|{{{p11_type|}}}]] {{LSL Param|{{{p11_name|}}}}}{{#if:{{{p12_name|}}}{{{p12_type|}}}|, [[{{{p12_type|}}}{{#var:lang}}|{{{p12_type|}}}]] {{LSL Param|{{{p12_name|}}}}}}}}}}}}}}}}}}}}}}}}}}}}} )<nowiki>;</nowiki></span>
<div style="padding: 0.5em; min-height: {{#if:{{{func_complexity|}}}|6em;|5em;}}">{{#ifeq:{{#var:mode}}|user|{{#if:{{#var:floater}}|<div id="box" style="float:right;">{{#var:floater}}</div>}}|<div id="box" style="float:right; margin: 0 0.5em; font-size:90%;">
<div style="padding: 0.5em; min-height: {{#if:{{{func_complexity|}}}|6em;|5em;}}">{{#if:{{#pos:{{#var:moded}}|u}}|{{#if:{{#var:floater}}|<div id="box" style="float:right;">{{#var:floater}}</div>}}|<div id="box" style="float:right; margin: 0 0.5em; font-size:90%;">
{{{!}} class="collapsible"
{{{!}} class="collapsible"
{{!}}- style="font-size:75%;"
{{!}}- style="font-size:75%;"
Line 327: Line 334:
</div></div>}}
</div></div>}}
<div style="display:none" class="hidden-text" id="hidden-text">{{#var:hidden-text}}</div>
<div style="display:none" class="hidden-text" id="hidden-text">{{#var:hidden-text}}</div>
{{#var:footer}} {{#if:{{#var:self}}|| {{#switch:{{#var:mode}}|request|user=|#default= [[Category:LSL Functions{{#var:lang}}]] {{#ifexpr:({{#var:BugCounter}} + 0) > 0|[[Category:LSL topics with bugs{{#var:lang}}]] [[Category:LSL topics with the most bugs{{#var:lang}}| {{#pad:{{#expr:100-{{#var:BugCounter}}}}|2|0}}{{PAGENAME}}]]}} [[Category:LSL Functions/ID{{#var:lang}}| {{padleft:{{#var:func_id}}|5|0}}]] {{#if:{{#var:examples}}||[[Category:LSL Needs Example{{#var:lang}}]]}} {{LSL Unhelpful|{{{func}}}|}} }} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}]]}} }}</includeonly>
{{#var:footer}} {{#if:{{#var:self}}|| {{#if:{{#pos:{{#var:moded}}|r}}{{#pos:{{#var:moded}}|u}}|| [[Category:LSL Functions{{#var:lang}}]] {{#if:{{#pos:{{#var:moded}}|f}}||{{#ifexpr:({{#var:BugCounter}} + 0) > 0|[[Category:LSL topics with bugs{{#var:lang}}]] [[Category:LSL topics with the most bugs{{#var:lang}}| {{#pad:{{#expr:100-{{#var:BugCounter}}}}|2|0}}{{PAGENAME}}]]}}}} {{#iferror:{{#expr:{{#var:func_id}}}}||[[Category:LSL Functions/ID{{#var:lang}}| {{padleft:{{#var:func_id}}|5|0}}]]}} {{#if:{{#var:examples}}||[[Category:LSL Needs Example{{#var:lang}}]]}} {{LSL Unhelpful|{{{func}}}|}} }} {{#if:{{{cat1|}}}|[[Category:LSL {{{cat1}}}]]}} {{#if:{{{cat2|}}}|[[Category:LSL {{{cat2}}}]]}} {{#if:{{{cat3|}}}|[[Category:LSL {{{cat3}}}]]}} {{#if:{{{cat4|}}}|[[Category:LSL {{{cat4}}}]]}} {{#if:{{{cat5|}}}|[[Category:LSL {{{cat5}}}]]}} {{#if:{{{cat6|}}}|[[Category:LSL {{{cat6}}}]]}} {{#if:{{{cat7|}}}|[[Category:LSL {{{cat7}}}]]}} {{#if:{{{cat8|}}}|[[Category:LSL {{{cat8}}}]]}} }}</includeonly>

Revision as of 15:47, 8 March 2010