From f2e2af2de0eb09ed79516a1b5d09b04aa4e9b80f Mon Sep 17 00:00:00 2001 From: Alan Rodas Bonjour Date: Mon, 18 May 2020 13:32:52 -0300 Subject: [PATCH] Fix teacher not starting --- .../about-gobstones/about-gobstones.html | 2 +- app/elements/gobstones-ide/gobstones-ide.html | 4 +- .../gobstones-teacher/gobstones-teacher.html | 42 +++++++++++++------ app/index.html | 2 +- gulpfile.js | 20 ++++----- package.json | 2 +- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/app/elements/about-gobstones/about-gobstones.html b/app/elements/about-gobstones/about-gobstones.html index 7f39f7f8..cdb9fe7c 100644 --- a/app/elements/about-gobstones/about-gobstones.html +++ b/app/elements/about-gobstones/about-gobstones.html @@ -11,7 +11,7 @@ -
diff --git a/app/elements/gobstones-teacher/gobstones-teacher.html b/app/elements/gobstones-teacher/gobstones-teacher.html index 93fa011d..19d12645 100644 --- a/app/elements/gobstones-teacher/gobstones-teacher.html +++ b/app/elements/gobstones-teacher/gobstones-teacher.html @@ -1,4 +1,5 @@ + @@ -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 { @@ -66,7 +76,7 @@ [[localize("blocks")]] - + [[localize("code")]] [[localize("teachers-library")]] [[localize("students-library")]] @@ -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(() => { @@ -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() { @@ -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; @@ -515,9 +532,6 @@ } this.blocksSyncEnabled = true; - this.customStyle["--fab-sync-background"] = this.BLOCKS_SYNC_ON_COLOR; - this.updateStyles(); - this._copyBlocksToCode(); }, @@ -529,7 +543,9 @@ }, _onBlocksSyncClick: function() { - if (this.blocksSyncEnabled) this._setBlocksSyncOff(); + if (this.blocksSyncEnabled) { + this._setBlocksSyncOff(); + } else this._setBlocksSyncOn(); }, diff --git a/app/index.html b/app/index.html index a33c8381..71bed4a2 100644 --- a/app/index.html +++ b/app/index.html @@ -45,7 +45,7 @@ - + diff --git a/gulpfile.js b/gulpfile.js index 75a8271c..8549d0eb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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})); }; @@ -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({ diff --git a/package.json b/package.json index 304e1387..b4cc1d09 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gobstones-web", "description": "Gobstones Web", - "version": "2.17.2", + "version": "2.18.0", "private": true, "licence": "GPLv3", "author": "Gobstones (https://gobstones.github.io)",