Skip to content

Commit 3ae79d9

Browse files
committed
Removed info overlay from runner instance.
1 parent 78ee3d3 commit 3ae79d9

File tree

8 files changed

+30
-146
lines changed

8 files changed

+30
-146
lines changed

package-lock.json

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"jsdoc": "^3.5.5",
1212
"npm": "^5.8.0",
1313
"npm-check-updates": "^2.14.1",
14-
"nw": "^0.29.4",
14+
"nw": "^0.30.0",
1515
"nw-builder": "^3.5.1",
1616
"rimraf": "^2.6.2"
1717
},

src/mode/lego/ev3/runner.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@ cwc.mode.lego.ev3.Runner.prototype.decorate = function() {
143143
'updateUltrasonicSensor');
144144

145145
// Info template
146-
this.runner.showInfoButton(true);
147-
this.runner.setInfoTemplate(cwc.soy.mode.ev3.Runner.info);
146+
// this.runner.setInfoTemplate(cwc.soy.mode.ev3.Runner.info);
148147
this.runner.setCleanUpFunction(this.api.cleanUp, this.api);
149148
this.runner.decorate(this.node);
150149

src/ui/runner/runner.gss

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17+
1718
#{$prefix}runner-body,
1819
#{$prefix}runner-chrome,
1920
#{$prefix}runner-content {
@@ -101,14 +102,6 @@
101102
background: #fff;
102103
}
103104

104-
#{$prefix}runner-info {
105-
position: absolute;
106-
width: 100%;
107-
height: 100%;
108-
z-index: 10;
109-
background: #fff;
110-
}
111-
112105
#{$prefix}runner-terminal {
113106
position: absolute;
114107
height: 200px;

src/ui/runner/runner.js

Lines changed: 7 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ cwc.ui.Runner = function(helper) {
6464
/** @type {Element} */
6565
this.nodeTerminal = null;
6666

67-
/** @type {Element} */
68-
this.nodeInfo = null;
69-
7067
/** @type {Element} */
7168
this.nodeOverlay = null;
7269

@@ -79,9 +76,6 @@ cwc.ui.Runner = function(helper) {
7976
/** @type {Webview} */
8077
this.content = null;
8178

82-
/** @type {function(Object, null=, Object<string, *>=):*} */
83-
this.infoTemplate = function() {};
84-
8579
/** @type {function(Object, null=, Object<string, *>=):*} */
8680
this.overlayTemplate = function() {};
8781

@@ -126,6 +120,9 @@ cwc.ui.Runner = function(helper) {
126120

127121
/** @private {!cwc.utils.Events} */
128122
this.events_ = new cwc.utils.Events(this.name);
123+
124+
/** @private {!cwc.utils.Logger} */
125+
this.log_ = new cwc.utils.Logger(this.name);
129126
};
130127

131128

@@ -136,7 +133,7 @@ cwc.ui.Runner = function(helper) {
136133
cwc.ui.Runner.prototype.decorate = function(node) {
137134
this.node = node || goog.dom.getElement(this.prefix + 'chrome');
138135
if (!this.node) {
139-
console.error('Invalid Runner node:', this.node);
136+
this.log_.error('Invalid Runner node:', this.node);
140137
return;
141138
}
142139

@@ -145,8 +142,6 @@ cwc.ui.Runner.prototype.decorate = function(node) {
145142
toolbarPrefix: this.helper.getPrefix('runner-toolbar'),
146143
});
147144

148-
this.nodeInfo = goog.dom.getElement(this.prefix + 'info');
149-
150145
// Runtime
151146
this.nodeRuntime = goog.dom.getElement(this.prefix + 'runtime');
152147

@@ -167,13 +162,6 @@ cwc.ui.Runner.prototype.decorate = function(node) {
167162
this.statusbar.decorate(nodeStatusbar);
168163
}
169164

170-
// Infobar
171-
let nodeInfobar = goog.dom.getElement(this.prefix + 'infobar');
172-
if (nodeInfobar) {
173-
this.infobar = new cwc.ui.RunnerInfobar(this.helper);
174-
this.infobar.decorate(nodeInfobar);
175-
}
176-
177165
// Monitor
178166
this.nodeMonitor = goog.dom.getElement(this.prefix + 'monitor');
179167
this.monitor = new cwc.ui.RunnerMonitor(this.helper);
@@ -193,14 +181,6 @@ cwc.ui.Runner.prototype.decorate = function(node) {
193181
this.showOverlay(this.overlayTemplate ? true : false);
194182
this.renderOverlayTemplate(this.overlayTemplate);
195183

196-
// Info overlay
197-
let hasInfoTemplate = goog.isDefAndNotNull(this.infoTemplate);
198-
if (this.toolbar) {
199-
this.toolbar.enableInfoButton(hasInfoTemplate);
200-
}
201-
this.showInfo(hasInfoTemplate);
202-
this.renderInfoTemplate(this.infoTemplate);
203-
204184
// Runner
205185
this.connector.init(true);
206186
let layoutInstance = this.helper.getInstance('layout');
@@ -213,15 +193,6 @@ cwc.ui.Runner.prototype.decorate = function(node) {
213193
};
214194

215195

216-
/**
217-
* Sets the info template.
218-
* @param {!function(Object, null=, Object<string, *>=):*} template
219-
*/
220-
cwc.ui.Runner.prototype.setInfoTemplate = function(template) {
221-
this.infoTemplate = template;
222-
};
223-
224-
225196
/**
226197
* Sets the terminate template.
227198
* @param {!function(Object, null=, Object<string, *>=):*} template
@@ -232,18 +203,7 @@ cwc.ui.Runner.prototype.setOverlayTemplate = function(template, prefix = '') {
232203
this.overlayTemplate = template;
233204
this.overlayTemplatePrefix = prefix;
234205
} else {
235-
console.error('None overlay template!');
236-
}
237-
};
238-
239-
240-
/**
241-
* Render the info template.
242-
* @param {function(Object, null=, Object<string, *>=):*} template
243-
*/
244-
cwc.ui.Runner.prototype.renderInfoTemplate = function(template) {
245-
if (this.nodeInfo && template) {
246-
goog.soy.renderElement(this.nodeInfo, template);
206+
this.log_.error('None overlay template!');
247207
}
248208
};
249209

@@ -276,37 +236,6 @@ cwc.ui.Runner.prototype.setCleanUpFunction = function(func, scope) {
276236
};
277237

278238

279-
/**
280-
* @param {boolean} visible
281-
*/
282-
cwc.ui.Runner.prototype.showInfoButton = function(visible) {
283-
if (this.toolbar) {
284-
this.toolbar.showInfoButton(visible);
285-
}
286-
};
287-
288-
289-
/**
290-
* Toggles the info window.
291-
*/
292-
cwc.ui.Runner.prototype.toggleInfo = function() {
293-
if (this.nodeInfo) {
294-
this.showInfo(!goog.style.isElementShown(this.nodeInfo));
295-
}
296-
};
297-
298-
299-
/**
300-
* Shows / hides info window.
301-
* @param {boolean} visible
302-
*/
303-
cwc.ui.Runner.prototype.showInfo = function(visible) {
304-
if (this.nodeInfo) {
305-
goog.style.setElementShown(this.nodeInfo, visible);
306-
}
307-
};
308-
309-
310239
/**
311240
* Shows / hides overlay window.
312241
* @param {boolean} visible
@@ -410,15 +339,14 @@ cwc.ui.Runner.prototype.run = function() {
410339
let rendererInstance = this.helper.getInstance('renderer', true);
411340
let contentUrl = rendererInstance.getContentUrl();
412341
if (!contentUrl) {
413-
console.error('Was not able to get content url!');
342+
this.log_.error('Was not able to get content url!');
414343
return;
415344
}
416345

417346
if (this.infobar) {
418347
this.infobar.clear();
419348
}
420349

421-
this.showInfo(false);
422350
if (this.content) {
423351
if (this.status == cwc.ui.StatusbarState.LOADING ||
424352
this.status == cwc.ui.StatusbarState.UNRESPONSIVE) {
@@ -506,7 +434,7 @@ cwc.ui.Runner.prototype.terminate = function() {
506434
*/
507435
cwc.ui.Runner.prototype.remove = function() {
508436
if (this.content) {
509-
console.info('Remove Runner...');
437+
this.log_.info('Remove Runner...');
510438
this.terminate();
511439
this.nodeRuntime.removeChild(this.content);
512440
this.content = null;

src/ui/runner/runner.soy

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
<div id="{$prefix}body">
2929
{call .toolbar_ data="all" /}
3030
<div id="{$prefix}content">
31-
<div id="{$prefix}info"></div>
3231
<div id="{$prefix}status"></div>
3332
<div id="{$prefix}statusbar"></div>
3433
<div id="{$prefix}overlay"></div>
@@ -97,13 +96,6 @@
9796
{param opt_title: 'Collapse Blockly editor.' /}
9897
{/call}
9998

100-
{call cwc.soy.ui.Template.navigationIcon}
101-
{param prefix: $toolbarPrefix /}
102-
{param id: 'info' /}
103-
{param icon: 'info_outline' /}
104-
{param opt_title: 'Shows general information...' /}
105-
{/call}
106-
10799
</nav>
108100
</div>
109101
</header>

0 commit comments

Comments
 (0)