From ff45f61b68228d1ee4cf07a7a7dfdd52d29c4b30 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Fri, 9 Dec 2022 20:46:01 +0000 Subject: [PATCH] Fixed the snackbar --- Gruntfile.js | 10 ++++++++++ package.json | 2 +- src/web/stylesheets/layout/_modals.css | 2 +- src/web/utils/statusBar.mjs | 2 +- src/web/waiters/OutputWaiter.mjs | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 78c26532..5cf9428f 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -398,6 +398,16 @@ module.exports = function (grunt) { `find ./node_modules/crypto-api/src/ \\( -type d -name .git -prune \\) -o -type f -print0 | xargs -0 sed -i -e '/\\.mjs/!s/\\(from "\\.[^"]*\\)";/\\1.mjs";/g'` ].join(" "), stdout: false + }, + fixSnackbarMarkup: { + command: [ + `[[ "$OSTYPE" == "darwin"* ]]`, + "&&", + `sed -i '' 's/
/
/g' ./node_modules/snackbarjs/src/snackbar.js`, + "||", + `sed -i 's/
/
/g' ./node_modules/snackbarjs/src/snackbar.js` + ].join(" "), + stdout: false } }, }); diff --git a/package.json b/package.json index 4ed5d5eb..54662c00 100644 --- a/package.json +++ b/package.json @@ -184,7 +184,7 @@ "testui": "npx grunt testui", "testuidev": "npx nightwatch --env=dev", "lint": "npx grunt lint", - "postinstall": "npx grunt exec:fixCryptoApiImports", + "postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup", "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs", "minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs", "getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'", diff --git a/src/web/stylesheets/layout/_modals.css b/src/web/stylesheets/layout/_modals.css index c1745eeb..affc372d 100755 --- a/src/web/stylesheets/layout/_modals.css +++ b/src/web/stylesheets/layout/_modals.css @@ -107,4 +107,4 @@ background-image: linear-gradient(to top, var(--input-highlight-colour) 2px, rgba(0, 0, 0, 0) 2px), linear-gradient(to top, var(--primary-border-colour) 1px, rgba(0, 0, 0, 0) 1px); -} \ No newline at end of file +} diff --git a/src/web/utils/statusBar.mjs b/src/web/utils/statusBar.mjs index 43c5f89e..d58e8d68 100644 --- a/src/web/utils/statusBar.mjs +++ b/src/web/utils/statusBar.mjs @@ -111,7 +111,7 @@ class StatusBarPanel { */ chrEncSelectClick(e) { // preventDefault is required to stop the URL being modified and popState being triggered - e.preventDefault(); // TODO - this breaks the menus when you click the button itself + e.preventDefault(); const chrEncVal = parseInt(e.target.getAttribute("data-val"), 10); diff --git a/src/web/waiters/OutputWaiter.mjs b/src/web/waiters/OutputWaiter.mjs index 843adcf0..e88052d8 100755 --- a/src/web/waiters/OutputWaiter.mjs +++ b/src/web/waiters/OutputWaiter.mjs @@ -1274,7 +1274,7 @@ class OutputWaiter { * Handler for copy click events. * Copies the output to the clipboard */ - async copyClick() { // TODO - do we need this? + async copyClick() { const dish = this.getOutputDish(this.manager.tabs.getActiveTab("output")); if (dish === null) { this.app.alert("Could not find data to copy. Has this output been baked yet?", 3000);