From 413e6a0e6a884ef9811221a3f92353f1d3fa6544 Mon Sep 17 00:00:00 2001 From: natashasandy Date: Tue, 21 Oct 2014 18:03:15 -0700 Subject: Fixed percent symbols in custom blocks This fixes issue #476 --- byob.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'byob.js') diff --git a/byob.js b/byob.js index 1277bb6..71b3298 100644 --- a/byob.js +++ b/byob.js @@ -688,7 +688,8 @@ CustomCommandBlockMorph.prototype.labelPart = function (spec) { return CustomCommandBlockMorph.uber.labelPart.call(this, spec); } if ((spec[0] === '%') && (spec.length > 1)) { - part = new BlockInputFragmentMorph(spec.slice(1)); + var label = spec.replace(/%/g, ''); + part = new BlockInputFragmentMorph(label); } else { part = new BlockLabelFragmentMorph(spec); part.fontSize = this.fontSize; -- cgit v1.3.1 From 4768102b098281d4f2462d4c4b0fe8b5cf228ef6 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 20 Nov 2014 15:13:21 +0100 Subject: integrate percent sign fix for JSLint --- byob.js | 6 +++--- history.txt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'byob.js') diff --git a/byob.js b/byob.js index 71b3298..b5905ce 100644 --- a/byob.js +++ b/byob.js @@ -106,7 +106,7 @@ SymbolMorph, isNil*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2014-September-30'; +modules.byob = '2014-November-20'; // Declarations @@ -688,8 +688,8 @@ CustomCommandBlockMorph.prototype.labelPart = function (spec) { return CustomCommandBlockMorph.uber.labelPart.call(this, spec); } if ((spec[0] === '%') && (spec.length > 1)) { - var label = spec.replace(/%/g, ''); - part = new BlockInputFragmentMorph(label); + // part = new BlockInputFragmentMorph(spec.slice(1)); + part = new BlockInputFragmentMorph(spec.replace(/%/g, '')); } else { part = new BlockLabelFragmentMorph(spec); part.fontSize = this.fontSize; diff --git a/history.txt b/history.txt index 8cf87e7..b022790 100755 --- a/history.txt +++ b/history.txt @@ -2328,4 +2328,5 @@ ______ * Threads: Fixed #364 avoid “freezing” when calling LAUNCH on empty ring * Threads: Added optional “onComplete” callback to Process, thanks, @bromagosa! * GUI: Set Default Save location to Cloud on load, thanks, @cycomachead! -* GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) +* GUI: Updated the “About” Dialog with a mention of support from CDG (SAP Labs) +* BYOB: Percent sign fix for block labels, thanks, @natashasandy! -- cgit v1.3.1