Skip to content

Commit

Permalink
Fix teacher not starting
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrodas committed May 18, 2020
1 parent fe05d55 commit f2e2af2
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/elements/about-gobstones/about-gobstones.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</style>

<template>
<h1>[[localize("about-gobstones-web")]] (v2.17.2)</h1>
<h1>[[localize("about-gobstones-web")]] (v2.18.0)</h1>
<br>

<div>
Expand Down
4 changes: 1 addition & 3 deletions app/elements/gobstones-ide/gobstones-ide.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
<div class$="panel-container {{ideCss(showIsLoading)}}">
<div class="panel-left">
<gbs-editor-toolbar id="toolbar" project-type="[[projectType]]" id="toolbar"></gbs-editor-toolbar>

<template is="dom-if" if="{{isBlocksProject(projectType)}}">
<gobstones-blockly id="editor" with-runner></gobstones-blockly>
</template>
Expand All @@ -103,9 +102,8 @@
</template>

<template is="dom-if" if="{{isTeacherProject(projectType)}}">
<gobstones-teacher id="editor"></gobstones-editor>
<gobstones-teacher id="editor"></gobstones-teacher>
</template>

<div id="code-placeholder" class="code-placeholder"></div>
</div>

Expand Down
42 changes: 29 additions & 13 deletions app/elements/gobstones-teacher/gobstones-teacher.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/iron-icons/notification-icons.html">
<link rel="import" href="../../scripts/behaviors/busListenerBehavior.html">
<link rel="import" href="../../scripts/jquery.html">
<link rel="import" href="../../scripts/simplemde.html">
Expand All @@ -14,17 +15,26 @@
}

.fab-sync {
--paper-fab-background: var(--fab-sync-background);
/* --paper-fab-background: var(--fab-sync-background);
--paper-fab-keyboard-focus-background: var(--fab-sync-background);
*/
width: 10px;
height: 10px !important;
position: absolute;
left: 3px;
top: 3px;
--paper-fab-iron-icon: {
width: 10px !important;
height: 10px !important;
}
}

.fab-sync.sync-on {
background-color: #1da65b !important;
}

.fab-sync:after {
content: "➟";
.fab-sync.sync-off {
background-color: #d93c46 !important;
}

.editor {
Expand Down Expand Up @@ -66,7 +76,7 @@
</paper-tooltip>
<paper-tabs id="editorTab" selected="{{selectedTab}}" class="bottom self-end">
<paper-tab>[[localize("blocks")]]</paper-tab>
<paper-fab id="fab-sync-button" mini label="" class="fab-sync" on-click="_onBlocksSyncClick"></paper-fab>
<paper-fab id="fab-sync-button" mini icon="notification:sync-disabled" class="fab-sync sync-off" on-click="_onBlocksSyncClick"></paper-fab>
<paper-tab>[[localize("code")]]</paper-tab>
<paper-tab>[[localize("teachers-library")]]</paper-tab>
<paper-tab>[[localize("students-library")]]</paper-tab>
Expand Down Expand Up @@ -179,8 +189,8 @@
},

ready: function() {
this.BLOCKS_SYNC_ON_COLOR = "#03a9f4";
this.BLOCKS_SYNC_OFF_COLOR = "#666666";
this.BLOCKS_SYNC_ON_ICON = "notification:sync";
this.BLOCKS_SYNC_OFF_ICON = "notification:sync-disabled";
this._setBlocksSyncOff();

setTimeout(() => {
Expand Down Expand Up @@ -417,7 +427,9 @@
},

_setSolutionWorkspace: function(workspace) {
this.availableSolutions[this.selectedSolution].workspace.main = workspace;
if (this.availableSolutions[this.selectedSolution]) {
this.availableSolutions[this.selectedSolution].workspace.main = workspace;
}
},

_getSolutionLibrary: function() {
Expand Down Expand Up @@ -500,12 +512,17 @@
},

_setBlocksSyncOff: function() {
this.customStyle["--fab-sync-background"] = this.BLOCKS_SYNC_OFF_COLOR;
this.updateStyles();
this.$['fab-sync-button'].icon = this.BLOCKS_SYNC_OFF_ICON;
$(this.$['fab-sync-button']).removeClass('sync-on');
$(this.$['fab-sync-button']).addClass('sync-off');
this.blocksSyncEnabled = false;
},

_setBlocksSyncOn: function() {
this.$['fab-sync-button'].icon = this.BLOCKS_SYNC_ON_ICON;
$(this.$['fab-sync-button']).removeClass('sync-off');
$(this.$['fab-sync-button']).addClass('sync-on');

const generatedCode = this.generateCode(false);
const currentCode = this.solution.code.main;

Expand All @@ -515,9 +532,6 @@
}

this.blocksSyncEnabled = true;
this.customStyle["--fab-sync-background"] = this.BLOCKS_SYNC_ON_COLOR;
this.updateStyles();

this._copyBlocksToCode();
},

Expand All @@ -529,7 +543,9 @@
},

_onBlocksSyncClick: function() {
if (this.blocksSyncEnabled) this._setBlocksSyncOff();
if (this.blocksSyncEnabled) {
this._setBlocksSyncOff();
}
else this._setBlocksSyncOn();
},

Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

<!-- Avoid google translation -->
<meta name="google" content="notranslate">

<!-- Dark theme stylesheet - solo cambia algo cuando la clase de main es night -->
<link rel="stylesheet" href="styles/dark.css">

Expand Down
20 changes: 10 additions & 10 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var styleTask = function(stylesPath, srcs) {
.pipe($.changed(stylesPath, {extension: '.css'}))
.pipe($.autoprefixer(AUTOPREFIXER_BROWSERS))
.pipe(gulp.dest('.tmp/' + stylesPath))
.pipe($.minifyCss())
//.pipe($.minifyCss())
.pipe(gulp.dest(dist(stylesPath)))
.pipe($.size({title: stylesPath}));
};
Expand All @@ -76,20 +76,20 @@ var optimizeHtmlTask = function(src, dest) {
return gulp.src(src)
.pipe(assets)
// Concatenate and minify JavaScript
.pipe($.if('*.js', $.uglify({
preserveComments: 'some'
})))
//.pipe($.if('*.js', $.uglify({
// preserveComments: 'some'
//})))
// Concatenate and minify styles
// In case you are still using useref build blocks
.pipe($.if('*.css', $.minifyCss()))
//.pipe($.if('*.css', $.minifyCss()))
.pipe(assets.restore())
.pipe($.useref())
// Minify any HTML
.pipe($.if('*.html', $.minifyHtml({
quotes: true,
empty: true,
spare: true
})))
//.pipe($.if('*.html', $.minifyHtml({
// quotes: true,
// empty: true,
// spare: true
//})))
// Output files
.pipe(gulp.dest(dest))
.pipe($.size({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gobstones-web",
"description": "Gobstones Web",
"version": "2.17.2",
"version": "2.18.0",
"private": true,
"licence": "GPLv3",
"author": "Gobstones <[email protected]> (https://gobstones.github.io)",
Expand Down

0 comments on commit f2e2af2

Please sign in to comment.