Skip to content

Commit caae9cb

Browse files
committed
removing warnings about value behavior
1 parent 21efac0 commit caae9cb

File tree

16 files changed

+59
-63
lines changed

16 files changed

+59
-63
lines changed

public/app.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ const AppViewModel = DefineMap.extend('App',
2222
{
2323
env: {
2424
default: () => ({NODE_ENV:'development'}),
25-
set: function(newVal){
26-
console.log("ENV IS SET TO ", newVal);
27-
return newVal;
28-
},
2925
serialize: false
3026
},
3127
/**
@@ -211,7 +207,7 @@ stache.registerHelper("pageComponent", function(scope, options){
211207
template =
212208
"<can-import from='bitballs/components/" + pageComponent.moduleName + "'>" +
213209
"{{#if isResolved}}" +
214-
"{{#with scope.root}}<"+pageComponent.componentName + " " + pageComponent.attributes + "/>{{/with}}" +
210+
"{{#with scope.top}}<"+pageComponent.componentName + " " + pageComponent.attributes + "/>{{/with}}" +
215211
"{{else}}" +
216212
"Loading..." +
217213
"{{/if}}" +

public/components/game/details/details.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ exports.ViewModel = DefineMap.extend('GameDetailsVM',
6666
*/
6767
autoplay: {
6868
type: 'booolean',
69-
value: true
69+
default: true
7070
},
7171
/**
7272
* @property {bitballs/models/session} bitballs/components/game/details.session session
@@ -144,7 +144,7 @@ exports.ViewModel = DefineMap.extend('GameDetailsVM',
144144
* Array of statType objects from [bitballs/models/stat]
145145
*/
146146
statTypes: {
147-
value: Stat.statTypes
147+
default: Stat.statTypes
148148
},
149149
/**
150150
* @property {Object<{home: Number, away: Number}>}

public/components/game/details/details.stache

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@
2525
<th colspan="2">{{color}} - {{name}}</th>
2626
</tr>
2727
{{#each(players)}}
28-
<tr on:click="scope.root.showStatMenuFor(this,scope.element, scope.event)">
28+
<tr on:click="scope.vm.showStatMenuFor(this,scope.element, scope.event)">
2929
<td>{{name}}</td>
3030
<td class="stats-container">
31-
{{#each(scope.root.statsForPlayerId(id))}}
32-
<span on:click="scope.root.gotoTimeMinus5(time, scope.event)"
33-
class="stat-point stat-{{type}}" style="left: {{scope.root.statPercent(time)}}%">
31+
{{#each(scope.vm.statsForPlayerId(id))}}
32+
<span on:click="scope.vm.gotoTimeMinus5(time, scope.event)"
33+
class="stat-point stat-{{type}}" style="left: {{scope.vm.statPercent(time)}}%">
3434
{{type}}
35-
{{#if(scope.root.session.isAdmin())}}
35+
{{#if(scope.vm.session.isAdmin())}}
3636
<span class="destroy-btn glyphicon glyphicon-trash"
37-
on:click="scope.root.deleteStat(this, scope.event)"></span>
37+
on:click="scope.vm.deleteStat(this, scope.event)"></span>
3838
{{/if}}
3939
</span>
4040
{{/each}}
@@ -54,9 +54,9 @@
5454
<div class="arrow" style="top: 50%;"></div>
5555
<h3 class="popover-title">Add Stat for {{stat.player.name}}</h3>
5656
<div class="popover-content">
57-
<form on:submit="scope.root.createStat(scope.event)" action="">
57+
<form on:submit="scope.vm.createStat(scope.event)" action="">
5858
<label for="stat-type">Type</label>
59-
<select value:bind="stat.type" class="form-control" id="stat-type">
59+
<select bind="stat.type" class="form-control" id="stat-type">
6060
<option value=""/>
6161
{{#statTypes}}
6262
<option value="{{name}}">{{name}}</option>
@@ -67,7 +67,7 @@
6767
<label for="stat-time">Time (seconds)</label>
6868
<div class="row">
6969
<div class="col-xs-6">
70-
<input type="text" class="form-control" id="stat-time" value:bind="stat.time"/>
70+
<input type="text" class="form-control" id="stat-time" bind="stat.time"/>
7171
</div>
7272
<div class="col-xs-6">
7373
<a class="btn btn-default" on:click="minusTime(10)">-10 s</a>

public/components/navigation/navigation.stache

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<a href="{{routeUrl(page='account')}}">Account</a>
2323
</li>
2424
<li>
25-
<a href="javascript://" on:click="scope.root.logout()">Logout</a>
25+
<a href="javascript://" on:click="scope.vm.logout()">Logout</a>
2626
</li>
2727
{{else}}
2828
<li class="dropdown">
@@ -37,13 +37,13 @@
3737
</a>
3838
<ul class="dropdown-menu">
3939
<li>
40-
<form on:submit="scope.root.createSession(scope.event)" action="">
40+
<form on:submit="scope.vm.createSession(scope.event)" action="">
4141
<div class="form-group form-group-sm">
4242
<input
4343
class="form-control"
4444
id="user-email-nav"
4545
placeholder="email"
46-
value:bind="scope.root.loginSession.user.email"
46+
bind="loginSession.user.email"
4747
>
4848
</div>
4949
<div class="form-group form-group-sm">
@@ -52,13 +52,13 @@
5252
class="form-control"
5353
type="password"
5454
id="user-password-nav"
55-
value:bind="loginSession.user.password"
55+
bind="loginSession.user.password"
5656
>
5757
</div>
5858
<button type="submit" class="btn btn-primary btn-sm" >Login</button>
5959
<a href="{{routeUrl(page='register')}}"
6060
class="register-btn btn btn-link"
61-
on:click="scope.root.closeDropdown(scope.element)"
61+
on:click="scope.vm.closeDropdown(scope.element)"
6262
>
6363
or register
6464
</a>

public/components/player/edit/edit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ exports.ViewModel = DefineMap.extend("PlayerEditVM",
4747
**/
4848
isAdmin: {
4949
type: 'boolean',
50-
value: false
50+
default: false
5151
},
5252
/**
5353
* @property {bitballs/models/player} bitballs/components/player/edit.player player
@@ -57,7 +57,7 @@ exports.ViewModel = DefineMap.extend("PlayerEditVM",
5757
**/
5858
player: {
5959
Type: Player,
60-
Value: Player
60+
Default: Player
6161
},
6262
/**
6363
* @property {Boolean} bitballs/components/player/edit.isNewPlayer isNewPlayer

public/components/player/edit/edit.stache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="form-group">
1111
<label for="player-name">Name</label>
1212
<input type="text" class="form-control" id="player-name"
13-
placeholder="fullname" value:bind="player.name" />
13+
placeholder="fullname" bind="player.name" />
1414
</div>
1515
<div class="form-group">
1616
<label for="player-weight">Weight</label>
@@ -19,7 +19,7 @@
1919
class="form-control"
2020
id="player-weight"
2121
placeholder="weight in pounds"
22-
value:bind="string-to-any(~player.weight)" />
22+
bind="string-to-any(~player.weight)" />
2323
</div>
2424
<div class="form-group">
2525
<label for="player-height">Height</label>
@@ -28,7 +28,7 @@
2828
class="form-control"
2929
id="player-height"
3030
placeholder="height in inches (Ex: 71)"
31-
value:bind="string-to-any(~player.height)" />
31+
bind="string-to-any(~player.height)" />
3232
</div>
3333
<div class="form-group">
3434
<label for="player-birthday">Birthday</label>
@@ -37,7 +37,7 @@
3737
class="form-control"
3838
id="player-birthday"
3939
placeholder="day of birth"
40-
value:bind="player.birthDate" />
40+
bind="player.birthDate" />
4141
</div>
4242
<button type="submit" class="btn btn-primary" >{{#if(isNewPlayer)}}Create{{else}}Update{{/if}}</button>
4343
{{#unless(isNewPlayer)}}

public/components/player/list/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var ViewModel = exports.ViewModel = DefineMap.extend('PlayerListVM',
4747
**/
4848
isAdmin: {
4949
type: 'boolean',
50-
value: false
50+
default: false
5151
},
5252
/**
5353
* @property {bitballs/models/Player} bitballs/models/player editingPlayer
@@ -62,7 +62,7 @@ var ViewModel = exports.ViewModel = DefineMap.extend('PlayerListVM',
6262
* A [bitballs/models/player] model List.
6363
*/
6464
playersPromise: {
65-
value: function(){
65+
default: function(){
6666
return Player.getList({orderBy: "name"});
6767
}
6868
},

public/components/tournament/details/details.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
6363
**/
6464
isAdmin: {
6565
type: 'boolean',
66-
value: false
66+
default: false
6767
},
6868
/**
6969
* @property {Number} bitballs/components/tournament/details.tournamentId tournamentId
@@ -178,7 +178,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
178178
* A [bitballs/models/game] instance used to create a `Game`.
179179
**/
180180
game: {
181-
Value: Game
181+
Default: Game
182182
},
183183
/**
184184
* @property {bitballs/models/session} bitballs/components/tournament/details.session session
@@ -194,7 +194,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
194194
* A [bitballs/models/team] instance used to create a `Team`.
195195
**/
196196
team: {
197-
Value: Team
197+
Default: Team
198198
},
199199
/**
200200
* @property {Promise<bitballs/models/player.static.List>} bitballs/components/tournament/details.playersPromise playersPromise
@@ -203,7 +203,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
203203
* A promise that resolves to a [bitballs/models/player.static.List Team List].
204204
**/
205205
playersPromise: {
206-
value: function(){
206+
default: function(){
207207
return Player.getList({orderBy: "name"});
208208
}
209209
},
@@ -261,7 +261,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
261261
* The round selection made by the user.
262262
**/
263263
userSelectedRound: {
264-
value: null
264+
default: null
265265
},
266266
/**
267267
* @property {String} bitballs/components/tournament/details.selectedRound selectedRound
@@ -288,7 +288,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
288288
* The court selection made by the user.
289289
**/
290290
userSelectedCourt: {
291-
value: null
291+
default: null
292292
},
293293
/**
294294
* @property {String} bitballs/components/tournament/details.selectedCourt selectedCourt
@@ -307,7 +307,7 @@ export const ViewModel = DefineMap.extend('TournamentDetails', {sealed: false},
307307

308308
var selectedRoundEvent = this.stream("selectedRound");
309309
var setSelectedCourtEvent = setStream.map(function(selectedCourt){
310-
return {type: "selectedCourt", value: selectedCourt};
310+
return {type: "selectedCourt", default: selectedCourt};
311311
});
312312

313313
return setSelectedCourtEvent.merge(selectedRoundEvent).scan(function(selectedCourt, event){

public/components/tournament/details/details.stache

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848

4949
<div class="form-group">
5050
<label for="game-round">Round</label>
51-
<select value:bind="selectedRound" class="form-control" id="game-round">
51+
<select bind="selectedRound" class="form-control" id="game-round">
5252
{{#games.getAvailableRounds()}}
5353
<option value="{{.}}">{{.}}</option>
5454
{{/games.getAvailableRounds}}
@@ -57,7 +57,7 @@
5757

5858
<div class="form-group">
5959
<label for="game-court">Court</label>
60-
<select value:bind="string-to-any(~selectedCourt)" class="form-control" id="game-court">
60+
<select bind="string-to-any(~selectedCourt)" class="form-control" id="game-court">
6161
{{#games.getAvailableCourts(selectedRound)}}
6262
<option value="{{.}}">{{.}}</option>
6363
{{/games.getAvailableCourts}}
@@ -66,14 +66,14 @@
6666

6767
<div class="form-group">
6868
<label for="game-home">Home team</label>
69-
<select value:bind="game.homeTeamId" class="form-control" id="game-home">
69+
<select bind="game.homeTeamId" class="form-control" id="game-home">
7070
<option value=''/>
7171
{{#each(~availableTeamFor("home", selectedRound))}}
7272
<option value='{{id}}'>{{color}} - {{name}}</option>
7373
{{/each}}
7474
</select>
7575
<label for="game-away">Away team</label>
76-
<select value:bind="game.awayTeamId" class="form-control" id="game-away">
76+
<select bind="game.awayTeamId" class="form-control" id="game-away">
7777
<option value=''/>
7878
{{#each(~availableTeamFor("away", selectedRound))}}
7979
<option value='{{id}}'>{{color}} - {{name}}</option>
@@ -85,7 +85,7 @@
8585
<label for="game-videoUrl">YouTube URL</label>
8686
<input type="text" class="form-control" id="game-videoUrl"
8787
placeholder="https://www.youtube.com/watch?v=y5z1Ym2uJfs"
88-
value:bind="{game.videoUrl}" />
88+
bind="{game.videoUrl}" />
8989
</div>
9090

9191
<button type="submit" class="btn btn-default">Create</button>
@@ -138,12 +138,12 @@
138138
<div class="form-group">
139139
<label for="team-name">Name</label>
140140
<input type="text" class="form-control" id="team-name"
141-
placeholder="team name" value:bind="team.name" />
141+
placeholder="team name" bind="team.name" />
142142
</div>
143143

144144
<div class="form-group">
145145
<label for="team-color">Color</label>
146-
<select value:bind="team.color" class="form-control" id="team-color">
146+
<select bind="team.color" class="form-control" id="team-color">
147147
{{#each(availableColors)}}
148148
<option value="{{.}}">{{.}}</option>
149149
{{/each}}
@@ -152,7 +152,7 @@
152152

153153
<div class="form-group">
154154
<label for="team-player1">Player 1</label>
155-
<select value:bind="team.player1Id" class="form-control" id="team-player1">
155+
<select bind="team.player1Id" class="form-control" id="team-player1">
156156
<option value=''/>
157157
{{#eachOf(~availablePlayersFor(team,1))}}
158158
<option value='{{id}}'>{{name}}</option>
@@ -162,7 +162,7 @@
162162

163163
<div class="form-group">
164164
<label for="team-player2">Player 2</label>
165-
<select value:bind="team.player2Id" class="form-control" id="team-player2">
165+
<select bind="team.player2Id" class="form-control" id="team-player2">
166166
<option value=''/>
167167
{{#eachOf(~availablePlayersFor(team,2))}}
168168
<option value='{{id}}'>{{name}}</option>
@@ -172,7 +172,7 @@
172172

173173
<div class="form-group">
174174
<label for="team-player3">Player 3</label>
175-
<select value:bind="team.player3Id" class="form-control" id="team-player3">
175+
<select bind="team.player3Id" class="form-control" id="team-player3">
176176
<option value=''/>
177177
{{#eachOf(~availablePlayersFor(team,3))}}
178178
<option value='{{id}}'>{{name}}</option>
@@ -182,7 +182,7 @@
182182

183183
<div class="form-group">
184184
<label for="team-player4">Player 4</label>
185-
<select value:bind="team.player4Id" class="form-control" id="team-player4">
185+
<select bind="team.player4Id" class="form-control" id="team-player4">
186186
<option value=''/>
187187
{{#eachOf(~availablePlayersFor(team,4))}}
188188
<option value='{{id}}'>{{name}}</option>

public/components/tournament/list/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ exports.ViewModel = DefineMap.extend('TournamentList',
4848
**/
4949
tournament: {
5050
Type: Tournament,
51-
Value: Tournament
51+
Default: Tournament
5252
},
5353
/**
5454
* @property {Boolean} bitballs/components/tournament/list.isAdmin isAdmin
@@ -58,7 +58,7 @@ exports.ViewModel = DefineMap.extend('TournamentList',
5858
**/
5959
isAdmin: {
6060
type: 'boolean',
61-
value: false,
61+
default: false,
6262
},
6363
/**
6464
* @property {Promise<Tournament>} bitballs/components/tournament/list.savePromise savePromise

0 commit comments

Comments
 (0)