Skip to content

Commit

Permalink
Remove Confirmation
Browse files Browse the repository at this point in the history
Remove the new sprite confirmation feature from Scratch
  • Loading branch information
MaterArc authored Dec 28, 2024
1 parent 4f1bc7b commit b35118f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions features/remove-confirmation/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"title": "Remove Delete Confirmation",
"description": "Removes the delete confirmation prompt when deleting sprites in the Scratch editor.",
"credits": [
{ "username": "MaterArc", "url": "https://scratch.mit.edu/users/MaterArc/" }
],
"type": ["Editor"],
"tags": ["New", "Featured"],
"dynamic": true,
"styles": [{ "file": "style.css", "runOn": "/editor/*" }],
"scripts": [{ "file": "script.js", "runOn": "/editor/*" }]
}

12 changes: 12 additions & 0 deletions features/remove-confirmation/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default async function ({ feature, console }) {
ScratchTools.waitForElements("body", () => {
document.body.addEventListener("click", () => {
ScratchTools.waitForElements(
"[class^='delete-confirmation-prompt_ok-button_']",
(confirmButton) => {
if (feature.self.enabled) confirmButton.click();
}
);
});
});
}
4 changes: 4 additions & 0 deletions features/remove-confirmation/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[class*="delete-confirmation-prompt_modal-container"] {
visibility: hidden;
}

0 comments on commit b35118f

Please sign in to comment.