mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-26 09:58:48 +01:00
replace if by string.replace
This commit is contained in:
parent
c0d82707cc
commit
98f5851b47
1 changed files with 4 additions and 9 deletions
|
@ -114,16 +114,11 @@ function format_level( state ) {
|
|||
var substitutions = {
|
||||
'#': '<span class="starcell wall">#</span>',
|
||||
'x': '<span class="starcell gift">x</span>',
|
||||
' ': '<span class="starcell void"> </span>'
|
||||
' ': '<span class="starcell void"> </span>',
|
||||
'H': '<span class="starcell cube">H</span>',
|
||||
'@': '<span class="starcell ball">@</span>'
|
||||
};
|
||||
if ( state.moving == cell.BALL ) {
|
||||
substitutions[ '@' ] = '<span class="starcell ball selected">@</span>';
|
||||
substitutions[ 'H' ] = '<span class="starcell cube">H</span>';
|
||||
}
|
||||
else {
|
||||
substitutions[ '@' ] = '<span class="starcell ball">@</span>';
|
||||
substitutions[ 'H' ] = '<span class="starcell cube selected">H</span>';
|
||||
}
|
||||
substitutions[ state.moving ] = substitutions[ state.moving ].replace( '">', ' selected">' );
|
||||
var myReplacer = Replacer( substitutions );
|
||||
return myReplacer( state.board );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue