From 95ac249ad3a12a734df74f8ece561b21ec069ea6 Mon Sep 17 00:00:00 2001 From: derwehr Date: Tue, 12 Jul 2022 20:05:23 +0200 Subject: [PATCH 1/2] fix: add trailing slash to media option --- core/options.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/options.js b/core/options.js index af6994377dd..b69143d54a8 100644 --- a/core/options.js +++ b/core/options.js @@ -105,7 +105,8 @@ class Options { } let pathToMedia = 'https://blockly-demo.appspot.com/static/media/'; if (options['media']) { - pathToMedia = options['media']; + pathToMedia = options['media'].endsWith('/') ? options['media'] : + options['media'] + '/'; } else if (options['path']) { // 'path' is a deprecated option which has been replaced by 'media'. pathToMedia = options['path'] + 'media/'; From ae9020ad781aeef5db48cf2c78c8cb971a3a2ca7 Mon Sep 17 00:00:00 2001 From: derwehr Date: Tue, 12 Jul 2022 20:05:38 +0200 Subject: [PATCH 2/2] fix: add deprecation warning to path option --- core/options.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/options.js b/core/options.js index b69143d54a8..06886ff6b1d 100644 --- a/core/options.js +++ b/core/options.js @@ -15,6 +15,7 @@ */ goog.module('Blockly.Options'); +const deprecation = goog.require('Blockly.utils.deprecation'); const idGenerator = goog.require('Blockly.utils.idGenerator'); const registry = goog.require('Blockly.registry'); const toolbox = goog.require('Blockly.utils.toolbox'); @@ -109,6 +110,7 @@ class Options { options['media'] + '/'; } else if (options['path']) { // 'path' is a deprecated option which has been replaced by 'media'. + deprecation.warn('path', 'Nov 2014', 'Jul 2023', 'media'); pathToMedia = options['path'] + 'media/'; } let oneBasedIndex;