Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
d9fdb675
Commit
d9fdb675
authored
Nov 17, 2018
by
Ben Wheeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
redirect hash urls to url pathnames
parent
3b1b96a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/views/preview/preview.jsx
src/views/preview/preview.jsx
+13
-0
No files found.
src/views/preview/preview.jsx
View file @
d9fdb675
...
...
@@ -741,6 +741,19 @@ const ConnectedPreview = connect(
mapDispatchToProps
)(
Preview
);
// replace old Scratch 2.0-style hashtag URLs with updated format
if
(
window
.
location
.
hash
)
{
if
(
window
.
location
.
hash
===
'
#editor
'
)
{
history
.
replaceState
({},
document
.
title
,
`
${
window
.
location
.
origin
}${
window
.
location
.
pathname
}
editor
${
window
.
location
.
search
}
`
);
}
if
(
window
.
location
.
hash
===
'
#fullscreen
'
)
{
history
.
replaceState
({},
document
.
title
,
`
${
window
.
location
.
origin
}${
window
.
location
.
pathname
}
fullscreen
${
window
.
location
.
search
}
`
);
}
}
// initialize GUI by calling its reducer functions depending on URL
GUI
.
setAppElement
(
document
.
getElementById
(
'
app
'
));
const
initGuiState
=
guiInitialState
=>
{
const
pathname
=
window
.
location
.
pathname
.
toLowerCase
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment