From 06fa1a3b1b0f3c6c7d418b019046d3f1d5f84051 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Mon, 1 Jul 2024 19:18:56 +0100 Subject: [PATCH] Stop asteroids breaking the buildchain. Game's a bit broken but I've better things to do than fix an easter egg --- gulpfile.js | 4 ++-- pipeline/source_assets/js/src.js | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9c273f17..76b53616 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -70,14 +70,14 @@ function scripts() { .pipe(gulpif(function(file) { return interaction.includes(file.relative);}, con('interaction.js'))) .pipe(gulpif(function(file) { return jpop.includes(file.relative);}, con('jpop.js'))) .pipe(flatten()) - .pipe(terser()) + // Only minify if filename does not already denote it as minified + .pipe(gulpif(function(file) { return file.path.indexOf("min") == -1;},terser())) .pipe(gulp.dest(dest)) .pipe(browsersync.stream()); } function browserSync(done) { spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'}); - // TODO Wait for Django server to come up before browsersync, it seems inconsistent browsersync.init({ notify: true, open: false, diff --git a/pipeline/source_assets/js/src.js b/pipeline/source_assets/js/src.js index cc5a65df..bb18587f 100644 --- a/pipeline/source_assets/js/src.js +++ b/pipeline/source_assets/js/src.js @@ -17,14 +17,12 @@ jQuery(document).ready(function () { }); } }); - var easter_egg = new Konami(); - easter_egg.code = function () { + var easter_egg = new Konami(function () { var s = document.createElement('script'); s.type = 'text/javascript'; document.body.appendChild(s); - s.src = '{% static "js/asteroids.min.js"%}'; - ga('send', 'event', 'easter_egg', 'activated'); - } + s.src = '/static/js/asteroids.min.js'; + }); easter_egg.load(); }); //CTRL-Enter form submission