mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Merge pull request #2334 from chrisgarrity/feature/rename-preview
Rename /preview to /projects
This commit is contained in:
commit
ac6a870a3f
3 changed files with 8 additions and 8 deletions
|
@ -198,11 +198,11 @@
|
||||||
"title": "Microworlds"
|
"title": "Microworlds"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "preview",
|
"name": "projects",
|
||||||
"pattern": "^/preview(/editor|(/\\d+(/editor|/fullscreen)?)?)?/?(\\?.*)?$",
|
"pattern": "^/projects(/editor|(/\\d+(/editor|/fullscreen)?)?)?/?(\\?.*)?$",
|
||||||
"routeAlias": "/preview/?$",
|
"routeAlias": "/projects/?$",
|
||||||
"view": "preview/preview",
|
"view": "preview/preview",
|
||||||
"title": "Scratch 3.0 Preview"
|
"title": "Scratch Project"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "3faq",
|
"name": "3faq",
|
||||||
|
|
|
@ -66,7 +66,7 @@ class Preview extends React.Component {
|
||||||
]);
|
]);
|
||||||
const pathname = window.location.pathname.toLowerCase();
|
const pathname = window.location.pathname.toLowerCase();
|
||||||
const parts = pathname.split('/').filter(Boolean);
|
const parts = pathname.split('/').filter(Boolean);
|
||||||
// parts[0]: 'preview'
|
// parts[0]: 'projects'
|
||||||
// parts[1]: either :id or 'editor'
|
// parts[1]: either :id or 'editor'
|
||||||
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
|
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
|
||||||
|
|
||||||
|
@ -267,7 +267,7 @@ class Preview extends React.Component {
|
||||||
if (!this.props.playerMode) modePath = 'editor/';
|
if (!this.props.playerMode) modePath = 'editor/';
|
||||||
// fullscreen overrides editor
|
// fullscreen overrides editor
|
||||||
if (this.props.fullScreen) modePath = 'fullscreen/';
|
if (this.props.fullScreen) modePath = 'fullscreen/';
|
||||||
const newPath = `/preview/${idPath}${modePath}`;
|
const newPath = `/projects/${idPath}${modePath}`;
|
||||||
if (push) {
|
if (push) {
|
||||||
history.pushState(
|
history.pushState(
|
||||||
{},
|
{},
|
||||||
|
@ -782,7 +782,7 @@ GUI.setAppElement(document.getElementById('app'));
|
||||||
const initGuiState = guiInitialState => {
|
const initGuiState = guiInitialState => {
|
||||||
const pathname = window.location.pathname.toLowerCase();
|
const pathname = window.location.pathname.toLowerCase();
|
||||||
const parts = pathname.split('/').filter(Boolean);
|
const parts = pathname.split('/').filter(Boolean);
|
||||||
// parts[0]: 'preview'
|
// parts[0]: 'projects'
|
||||||
// parts[1]: either :id or 'editor'
|
// parts[1]: either :id or 'editor'
|
||||||
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
|
// parts[2]: undefined if no :id, otherwise either 'editor' or 'fullscreen'
|
||||||
if (parts.indexOf('editor') === -1) {
|
if (parts.indexOf('editor') === -1) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ const RemixCredit = props => {
|
||||||
),
|
),
|
||||||
projectLink: (
|
projectLink: (
|
||||||
<a
|
<a
|
||||||
href={`/preview/${projectInfo.id}`}
|
href={`/projects/${projectInfo.id}`}
|
||||||
title={projectInfo.title}
|
title={projectInfo.title}
|
||||||
>
|
>
|
||||||
{projectInfo.title}
|
{projectInfo.title}
|
||||||
|
|
Loading…
Reference in a new issue