diff --git a/build.js b/build.js index 20f3c0d..04c4d0a 100644 --- a/build.js +++ b/build.js @@ -15,11 +15,14 @@ console.log('Building Pixel Editor'); function copy_images(){ - gulp.src('./images/*.png') - .pipe(gulp.dest(path.join(BUILDDIR, SLUG))); - - gulp.src('./images/Splash images/*.png') - .pipe(gulp.dest(path.join(BUILDDIR, SLUG))); + // Icons + gulp.src('./images/*.png').pipe(gulp.dest(path.join(BUILDDIR, SLUG))); + // Splash images + gulp.src('./images/Splash images/*.png').pipe(gulp.dest(path.join(BUILDDIR, SLUG))); +} + +function copy_logs() { + gulp.src('logs/*.html').pipe(gulp.dest(path.join(BUILDDIR, SLUG))); } function render_js(){ @@ -59,4 +62,4 @@ function compile_page(){ // empty the build folder, or create it fs.rmdirSync(BUILDDIR, { recursive: true }); fs.mkdirSync(BUILDDIR); -gulp.parallel(copy_images, render_js, render_css, compile_page)(); +gulp.parallel(copy_images, copy_logs, render_js, render_css, compile_page)(); diff --git a/js/_logs.js b/js/_logs.js new file mode 100644 index 0000000..10de24f --- /dev/null +++ b/js/_logs.js @@ -0,0 +1,14 @@ +var rawFile = new XMLHttpRequest(); +rawFile.open("GET", '/pixel-editor/latestLog.html', false); +rawFile.onreadystatechange = function () +{ + if(rawFile.readyState === 4) + { + if(rawFile.status === 200 || rawFile.status == 0) + { + var allText = rawFile.responseText; + document.getElementById("latest-update").innerHTML = allText; + } + } +} +rawFile.send(null); \ No newline at end of file diff --git a/js/pixel-editor.js b/js/pixel-editor.js index c0cf293..93a321d 100644 --- a/js/pixel-editor.js +++ b/js/pixel-editor.js @@ -54,6 +54,7 @@ //=include _colorPicker.js //=include _paletteBlock.js //=include _splashPage.js +//=include _logs.js /**load file**/ //=include _loadImage.js diff --git a/logs/latestLog.html b/logs/latestLog.html new file mode 100644 index 0000000..a1bbe4a --- /dev/null +++ b/logs/latestLog.html @@ -0,0 +1 @@ +

Hello update

\ No newline at end of file diff --git a/views/pixel-editor.hbs b/views/pixel-editor.hbs index 50cc948..bac1a7e 100644 --- a/views/pixel-editor.hbs +++ b/views/pixel-editor.hbs @@ -622,5 +622,6 @@ + \ No newline at end of file