Update block_exporter_controller.js

Generator stub file type is set to javascript; unnecesarry conditions removed.
This commit is contained in:
Ziya ERKOC
2018-01-20 09:37:56 +03:00
committed by Andrew n marshall
parent 4bbd83820c
commit 97daddb01e

View File

@@ -132,18 +132,16 @@ BlockExporterController.prototype.export = function() {
BlocklyDevTools.Analytics.onWarning(msg);
alert(msg);
} else {
// Get generator stub code in the selected language for the blocks.
var genStubs = this.tools.getGeneratorCode(blockXmlMap,
language);
// Get the correct file extension.
var fileType = (language == 'JavaScript') ? 'javascript' : 'plain';
// Download the file.
FactoryUtils.createAndDownloadFile(
genStubs, generatorStub_filename + '.js', fileType);
genStubs, generatorStub_filename + '.js', 'javascript');
BlocklyDevTools.Analytics.onExport(
BlocklyDevTools.Analytics.GENERATOR,
(fileType == 'javascript' ?
{ format: BlocklyDevTools.Analytics.FORMAT_JS } : undefined));
BlocklyDevTools.Analytics.GENERATOR, { format: BlocklyDevTools.Analytics.FORMAT_JS });
}
}