Merge remote-tracking branch 'upstream/develop' into scratch-desktop

This commit is contained in:
Christopher Willis-Ford committed 2019-03-12 15:55:50 -07:00
commit 39279fa0ef
9 files changed
+29 -15

No files matched your search

+1
View File
@@ -141,6 +141,7 @@ const GUIComponent = props => {
<StageWrapper
isRendererSupported={isRendererSupported}
isRtl={isRtl}
loading={loading}
stageSize={STAGE_SIZE_MODES.large}
vm={vm}
>
+1 -1
View File
@@ -2,7 +2,7 @@
@import "../../css/z-index.css";
.background {
position: fixed;
position: absolute;
top: 0;
left: 0;
width: 100%;
@@ -35,6 +35,11 @@ const LoginDropdownMessages = defineMessages({ // eslint-disable-line no-unused-
defaultMessage: 'Need Help?',
description: 'Button text for user to indicate that they need help',
id: 'login.needHelp'
},
validationRequired: {
defaultMessage: 'This field is required',
description: 'Message to tell user they must enter text in a form field',
id: 'form.validationRequired'
}
});
@@ -6,6 +6,7 @@ import Box from '../box/box.jsx';
import {STAGE_DISPLAY_SIZES} from '../../lib/layout-constants.js';
import StageHeader from '../../containers/stage-header.jsx';
import Stage from '../../containers/stage.jsx';
import Loader from '../loader/loader.jsx';
import styles from './stage-wrapper.css';
@@ -13,6 +14,7 @@ const StageWrapperComponent = function (props) {
const {
isRtl,
isRendererSupported,
loading,
stageSize,
vm
} = props;
@@ -38,6 +40,9 @@ const StageWrapperComponent = function (props) {
null
}
</Box>
{loading ? (
<Loader />
) : null}
</Box>
);
};
@@ -45,6 +50,7 @@ const StageWrapperComponent = function (props) {
StageWrapperComponent.propTypes = {
isRendererSupported: PropTypes.bool.isRequired,
isRtl: PropTypes.bool,
loading: PropTypes.bool,
stageSize: PropTypes.oneOf(Object.keys(STAGE_DISPLAY_SIZES)).isRequired,
vm: PropTypes.instanceOf(VM).isRequired
};
+3 -2
View File
@@ -80,8 +80,9 @@ class SBFileUploader extends React.Component {
}
getProjectTitleFromFilename (fileInputFilename) {
if (!fileInputFilename) return '';
// only parse title from files like "filename.sb2" or "filename.sb3"
const matches = fileInputFilename.match(/^(.*)\.sb[23]$/);
// only parse title with valid scratch project extensions
// (.sb, .sb2, and .sb3)
const matches = fileInputFilename.match(/^(.*)\.sb[23]?$/);
if (!matches) return '';
return matches[1].substring(0, 100); // truncate project title to max 100 chars
}
+6 -2
View File
@@ -260,8 +260,12 @@ export default function (vm) {
return stageOptions.concat(stageVariableMenuItems);
}
// Get all the local variables (no lists) and add them to the menu.
const spriteVariableOptions =
vm.runtime.getSpriteTargetByName(selectedItem).getAllVariableNamesInScopeByType('', true);
const target = vm.runtime.getSpriteTargetByName(selectedItem);
let spriteVariableOptions = [];
// The target should exist, but there are ways for it not to (e.g. #4203).
if (target) {
spriteVariableOptions = target.getAllVariableNamesInScopeByType('', true);
}
const spriteVariableMenuItems = spriteVariableOptions.map(variable => [variable, variable]);
return spriteOptions.concat(spriteVariableMenuItems);
}
-3
View File
@@ -53,9 +53,6 @@ const vmManagerHOC = function (WrappedComponent) {
loadProject () {
return this.props.vm.loadProject(this.props.projectData)
.then(() => {
// Mark all the assets as clean since they just got loaded
this.props.vm.assets.forEach(asset => (asset.clean = true));
this.props.onLoadedProject(this.props.loadingState, this.props.canSave);
// Wrap in a setTimeout because skin loading in
// the renderer can be async.