diff --git a/apps/src/StudioApp.js b/apps/src/StudioApp.js index 2d39d5777d7b6..87e674af27b9a 100644 --- a/apps/src/StudioApp.js +++ b/apps/src/StudioApp.js @@ -260,7 +260,7 @@ StudioApp.prototype.init = function (config) { config.getCode = this.getCode.bind(this); copyrightStrings = config.copyrightStrings; - if (config.isLegacyShare && config.hideSource) { + if (config.legacyShareStyle && config.hideSource) { $("body").addClass("legacy-share-view"); if (dom.isMobile()) { $("body").addClass("legacy-share-view-mobile"); @@ -310,6 +310,7 @@ StudioApp.prototype.init = function (config) { level: config.level, noHowItWorks: config.noHowItWorks, isLegacyShare: config.isLegacyShare, + legacyShareStyle: config.legacyShareStyle, wireframeShare: config.wireframeShare, }); } @@ -467,7 +468,7 @@ StudioApp.prototype.init = function (config) { }.bind(this)); } - if (config.isLegacyShare && config.hideSource) { + if (config.legacyShareStyle && config.hideSource) { this.setupLegacyShareView(); } @@ -1917,7 +1918,7 @@ StudioApp.prototype.handleHideSource_ = function (options) { // Chrome-less share page. if (this.share) { - if (options.isLegacyShare || options.wireframeShare) { + if (options.legacyShareStyle || options.wireframeShare) { document.body.style.backgroundColor = '#202B34'; if (options.level.iframeEmbed) { // so help me god. @@ -1927,7 +1928,7 @@ StudioApp.prototype.handleHideSource_ = function (options) { $('.header-wrapper').hide(); var vizColumn = document.getElementById('visualizationColumn'); - if (dom.isMobile() && (options.isLegacyShare || !dom.isIPad())) { + if (dom.isMobile() && (options.legacyShareStyle || !dom.isIPad())) { $(vizColumn).addClass('chromelessShare'); } else { $(vizColumn).addClass('wireframeShare'); @@ -1955,7 +1956,7 @@ StudioApp.prototype.handleHideSource_ = function (options) { ReactDOM.render(React.createElement(WireframeButtons, { channelId: project.getCurrentId(), appType: project.getStandaloneApp(), - isLegacyShare: options.isLegacyShare, + isLegacyShare: !!options.isLegacyShare, }), div); } } diff --git a/apps/src/code-studio/appOptions.js b/apps/src/code-studio/appOptions.js index 111ae43a816a7..f1f869bd2ff5e 100644 --- a/apps/src/code-studio/appOptions.js +++ b/apps/src/code-studio/appOptions.js @@ -31,6 +31,7 @@ * @property {boolean} isExternalProjectLevel * @property {boolean} isChannelBacked * @property {boolean} isLegacyShare + * @property {boolean} legacyShareStyle * @property {PostMileStoneMode} postMilestoneMode * @property {string} puzzleRatingsUrl * @property {string} authoredHintViewRequestsUrl diff --git a/apps/src/code-studio/initApp/project.js b/apps/src/code-studio/initApp/project.js index c6c5a7927188e..fa1d799ffd83a 100644 --- a/apps/src/code-studio/initApp/project.js +++ b/apps/src/code-studio/initApp/project.js @@ -523,7 +523,7 @@ var projects = module.exports = { this.sourceHandler.setInitialLevelSource(currentSources.source); this.showMinimalProjectHeader(); } - } else if (appOptions.isLegacyShare && this.getStandaloneApp()) { + } else if (appOptions.legacyShareStyle && this.getStandaloneApp()) { this.setName('Untitled Project'); this.showMinimalProjectHeader(); } diff --git a/apps/src/templates/WireframeButtons.jsx b/apps/src/templates/WireframeButtons.jsx index 3f7ca0f461314..f5def09daf5ee 100644 --- a/apps/src/templates/WireframeButtons.jsx +++ b/apps/src/templates/WireframeButtons.jsx @@ -106,11 +106,7 @@ let WireframeButtons = React.createClass({ }, renderNewProjectButton: function () { - // Unfortunately, isLegacyShare currently has the wrong value (is true for non-legacy artist - // and playlab). So instead, we check the first letter (after the /) in the path name of the - // url, as legacy shares all start with /c - // var isLegacyShare = this.props.isLegacyShare; - var isLegacyShare = window.location.pathname[1] === 'c'; + const { isLegacyShare } = this.props; var appTypeAndLegacy = this.props.appType + (isLegacyShare ? '_legacy' : ''); var url = APP_TYPE_TO_NEW_PROJECT_URL[appTypeAndLegacy]; if (url) { diff --git a/apps/src/turtle/artist.js b/apps/src/turtle/artist.js index a42bad74d2fc6..443eadf7c4dc9 100644 --- a/apps/src/turtle/artist.js +++ b/apps/src/turtle/artist.js @@ -327,7 +327,7 @@ Artist.prototype.init = function (config) { this.studioApp_.setPageConstants(config, appSpecificConstants); var iconPath = '/blockly/media/turtle/' + - (config.isLegacyShare && config.hideSource ? 'icons_white.png' : 'icons.png'); + (config.legacyShareStyle && config.hideSource ? 'icons_white.png' : 'icons.png'); var visualizationColumn = (