Skip to content

Commit 3efe5f5

Browse files
committed
Simplified implementation and fixed smaller issues.
1 parent 743813f commit 3efe5f5

File tree

18 files changed

+204
-163
lines changed

18 files changed

+204
-163
lines changed

build/externs/blockly.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Blockly.WorkspaceSvg.prototype.setScale = function(newScale) {};
230230
Blockly.WorkspaceSvg.prototype.scrollCenter = function() {};
231231

232232
/**
233-
* @param {Node|string} tree
233+
* @param {Node|string=} tree
234234
*/
235235
Blockly.WorkspaceSvg.prototype.updateToolbox = function(tree) {};
236236

locales/deu/whats_new_screen.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @fileoverview Translation file for the What's New screen (german).
3+
*
4+
* @license Copyright 2018 The Coding with Chrome Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* @author [email protected] (Markus Bordihn)
19+
*/
20+
/* eslint-disable max-len */
21+
Locales['deu']['WHATS_NEW_SCREEN'] = {
22+
'SHOW_ON_CHANGE': 'Zeige diese Benachrichtigung, wenn eine neue Version installiert ist.',
23+
};

locales/eng/select_screen.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Locales['eng']['SELECT_SCREEN'] = {
2424
'BLUETOOTH_WEB_NOT_AVAILABLE': 'Required Web Bluetooth support is not available.',
2525
'LOAD_FILE': 'Load {$title}',
2626
'USE': 'Use',
27-
'ENABLE_WHATS_NEW': 'Show notification when a new version is installed.',
2827
};
2928

3029

locales/eng/whats_new_screen.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* @fileoverview Translation file for the What's New screen (english).
3+
*
4+
* @license Copyright 2018 The Coding with Chrome Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* @author [email protected] (Markus Bordihn)
19+
*/
20+
/* eslint-disable max-len */
21+
Locales['eng']['WHATS_NEW_SCREEN'] = {
22+
'SHOW_ON_CHANGE': 'Show notification when a new version is installed.',
23+
};

src/addon/message/message.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ goog.require('cwc.mode.Modder.Events');
2323
goog.require('cwc.mode.Type');
2424
goog.require('cwc.soy.addon.Message');
2525
goog.require('cwc.ui.SelectScreen.Events');
26+
goog.require('cwc.utils.Events');
2627
goog.require('cwc.utils.Logger');
2728

2829

src/frameworks/lego/ev3/ev3.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ goog.require('cwc.protocol.lego.ev3.Robots');
3333

3434
/**
3535
* @constructor
36-
* @struct
37-
* @final
36+
* @unrestricted
3837
* @export
3938
*/
4039
cwc.framework.lego.Ev3 = function() {

src/frameworks/messenger/command.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ goog.provide('cwc.framework.MessengerCommand');
2121

2222

2323
/**
24-
* @param {!cwc.Messenger} messenger
24+
* @param {!cwc.framework.Messenger} messenger
2525
* @constructor
2626
* @struct
2727
* @final
@@ -30,7 +30,7 @@ cwc.framework.MessengerCommand = function(messenger) {
3030
/** @type {string} */
3131
this.name = 'Messenger Display';
3232

33-
/** @private {!cwc.Messenger} */
33+
/** @private {!cwc.framework.Messenger} */
3434
this.messenger_ = messenger;
3535

3636
// Global mapping

src/frameworks/messenger/display.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ goog.provide('cwc.framework.MessengerDisplay');
2121

2222

2323
/**
24-
* @param {!Function} messenger
24+
* @param {!cwc.framework.Messenger} messenger
2525
* @constructor
2626
* @struct
2727
* @final
@@ -30,7 +30,7 @@ cwc.framework.MessengerDisplay = function(messenger) {
3030
/** @type {string} */
3131
this.name = 'Messenger Display';
3232

33-
/** @private {!cwc.Messenger} */
33+
/** @private {!cwc.framework.Messenger} */
3434
this.messenger_ = messenger;
3535

3636
// Global mapping

src/frameworks/sphero/sprk_plus/sprk_plus.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ cwc.framework.sphero.SprkPlus = function() {
5757
/** @private {number} */
5858
this.heading_ = 0;
5959

60-
/** @private {boolean} */
60+
/** @private {boolean|undefined} */
6161
this.state_ = undefined;
6262

6363
/** @private {!cwc.framework.Messenger} */
@@ -140,8 +140,8 @@ cwc.framework.sphero.SprkPlus.prototype.setMotionTimeout = function(timeout,
140140
* @param {number=} delay in msec
141141
* @export
142142
*/
143-
cwc.framework.sphero.SprkPlus.prototype.roll = function(speed, heading, state,
144-
delay) {
143+
cwc.framework.sphero.SprkPlus.prototype.roll = function(speed, heading = 0,
144+
state, delay) {
145145
this.heading_ = heading;
146146
this.state_ = state;
147147
this.messenger_.send('roll', {
@@ -260,7 +260,7 @@ cwc.framework.sphero.SprkPlus.prototype.handleVelocity_ = function(data) {
260260

261261

262262
/**
263-
* @param {event} e
263+
* @param {Event} e
264264
* @private
265265
*/
266266
cwc.framework.sphero.SprkPlus.prototype.handlePositionChange_ = function(e) {

src/ui/builder.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ cwc.ui.Builder.prototype.decorateUI = function() {
271271
this.setProgressFunc('Prepare GAPI ...', this.prepareGAPI);
272272
}
273273
this.setProgressFunc('Loading select screen ...', this.showSelectScreen);
274+
this.setProgressFunc('Loading whats new screen ...', this.showWhatsNew);
274275
this.setProgressFunc('Loading cache ...', this.loadCache).then(() => {
275276
// Done.
276277
this.setProgress('Starting Coding with Chrome', 100);
@@ -571,6 +572,18 @@ cwc.ui.Builder.prototype.showSelectScreen = function() {
571572
}
572573
};
573574

575+
576+
/**
577+
* Shows what's new screen.
578+
*/
579+
cwc.ui.Builder.prototype.showWhatsNew = function() {
580+
let whatsNewScreen = this.helper.getInstance('whatsNew');
581+
if (whatsNewScreen) {
582+
whatsNewScreen.showWhatsNewScreen();
583+
}
584+
};
585+
586+
574587
/**
575588
* @param {string} name
576589
* @private

0 commit comments

Comments
 (0)