From dab7fd5751e12554c49ab43335d1295c4620fa32 Mon Sep 17 00:00:00 2001 From: picklesrus Date: Wed, 7 Sep 2016 11:50:50 -0700 Subject: [PATCH] Cherrypick fixes made directly to master back into develop (#619) * Check result of window.confirm before deleting variables. * Create CONTRIBUTING.md --- CONTRIBUTING.md | 5 +++++ core/workspace.js | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..8cfd55151 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,5 @@ +# Contributing to Blockly + +Please make pull requests against develop, not master. If your patch needs to go into master immediately, include a note in your PR. + +For more information, head over to the [Blockly Developers site](https://developers.google.com/blockly/guides/modify/contributing). diff --git a/core/workspace.js b/core/workspace.js index db7415753..a8e97c04b 100644 --- a/core/workspace.js +++ b/core/workspace.js @@ -322,9 +322,12 @@ Blockly.Workspace.prototype.deleteVariable = function(name) { return; } } - window.confirm( + var ok = window.confirm( Blockly.Msg.DELETE_VARIABLE_CONFIRMATION.replace('%1', uses.length). replace('%2', name)); + if (!ok) { + return; + } } Blockly.Events.setGroup(true);