use "var" keyword to make "local" variables really local
This commit is contained in:
parent
a3198c9924
commit
0561fc2e1f
1 changed files with 12 additions and 12 deletions
24
keyboard.xml
24
keyboard.xml
|
@ -45,7 +45,7 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
var node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
||||||
if ( node.getValue() == "altitude-hold" ) {
|
if ( node.getValue() == "altitude-hold" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -79,7 +79,7 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
var node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
||||||
if ( node.getValue() == "gs1-hold" ) {
|
if ( node.getValue() == "gs1-hold" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -95,7 +95,7 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/heading", 1);
|
var node = props.globals.getNode("/autopilot/locks/heading", 1);
|
||||||
if ( node.getValue() == "dg-heading-hold" ) {
|
if ( node.getValue() == "dg-heading-hold" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -131,7 +131,7 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/heading", 1);
|
var node = props.globals.getNode("/autopilot/locks/heading", 1);
|
||||||
if ( node.getValue() == "nav1-hold" ) {
|
if ( node.getValue() == "nav1-hold" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -147,12 +147,12 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
var node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
||||||
if ( node.getValue() == "pitch-hold" ) {
|
if ( node.getValue() == "pitch-hold" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
node.setValue( "pitch-hold" );
|
node.setValue( "pitch-hold" );
|
||||||
pitch = props.globals.getNode("/autopilot/settings/target-pitch-deg", 1);
|
var pitch = props.globals.getNode("/autopilot/settings/target-pitch-deg", 1);
|
||||||
pitch.setValue( getprop("/orientation/pitch-deg") );
|
pitch.setValue( getprop("/orientation/pitch-deg") );
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -174,7 +174,7 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/speed", 1);
|
var node = props.globals.getNode("/autopilot/locks/speed", 1);
|
||||||
if ( node.getValue() == "speed-with-throttle" ) {
|
if ( node.getValue() == "speed-with-throttle" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -190,12 +190,12 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
var node = props.globals.getNode("/autopilot/locks/altitude", 1);
|
||||||
if ( node.getValue() == "agl-hold" ) {
|
if ( node.getValue() == "agl-hold" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
node.setValue( "agl-hold" );
|
node.setValue( "agl-hold" );
|
||||||
agl = props.globals.getNode("/autopilot/settings/target-agl-ft", 1);
|
var agl = props.globals.getNode("/autopilot/settings/target-agl-ft", 1);
|
||||||
agl.setValue( getprop("/position/altitude-agl-ft") );
|
agl.setValue( getprop("/position/altitude-agl-ft") );
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -233,7 +233,7 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
node = props.globals.getNode("/autopilot/locks/heading", 1);
|
var node = props.globals.getNode("/autopilot/locks/heading", 1);
|
||||||
if ( node.getValue() == "wing-leveler" ) {
|
if ( node.getValue() == "wing-leveler" ) {
|
||||||
node.setValue( "" );
|
node.setValue( "" );
|
||||||
} else {
|
} else {
|
||||||
|
@ -1106,8 +1106,8 @@ top down before the key bindings are parsed.
|
||||||
<binding>
|
<binding>
|
||||||
<command>nasal</command>
|
<command>nasal</command>
|
||||||
<script>
|
<script>
|
||||||
prop = "/autopilot/locks/heading";
|
var prop = "/autopilot/locks/heading";
|
||||||
curr = getprop(prop);
|
var curr = getprop(prop);
|
||||||
if(curr == "true-heading-hold") { setprop(prop, ""); }
|
if(curr == "true-heading-hold") { setprop(prop, ""); }
|
||||||
else { setprop(prop, "true-heading-hold"); }
|
else { setprop(prop, "true-heading-hold"); }
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Add table
Reference in a new issue