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
efd23ed8
Unverified
Commit
efd23ed8
authored
Nov 19, 2018
by
Benjamin Wheeler
Committed by
GitHub
Nov 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2322 from benjiwheeler/static-host-cdn
use cdn.scratch.ly in staging
parents
2065090b
7ee46350
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
7 deletions
+12
-7
.travis.yml
.travis.yml
+1
-1
src/components/grid/grid.jsx
src/components/grid/grid.jsx
+2
-1
src/components/thumbnailcolumn/thumbnailcolumn.jsx
src/components/thumbnailcolumn/thumbnailcolumn.jsx
+2
-1
src/lib/user-thumbnail.js
src/lib/user-thumbnail.js
+1
-1
src/views/messages/message-rows/comment-message.jsx
src/views/messages/message-rows/comment-message.jsx
+2
-1
src/views/preview/presentation.jsx
src/views/preview/presentation.jsx
+2
-1
src/views/preview/remix-credit.jsx
src/views/preview/remix-credit.jsx
+2
-1
No files found.
.travis.yml
View file @
efd23ed8
...
@@ -44,7 +44,7 @@ env:
...
@@ -44,7 +44,7 @@ env:
-
PROJECT_HOST=${!PROJECT_HOST_VAR}
-
PROJECT_HOST=${!PROJECT_HOST_VAR}
-
PROJECT_HOST=${PROJECT_HOST:-$PROJECT_HOST_STAGING}
-
PROJECT_HOST=${PROJECT_HOST:-$PROJECT_HOST_STAGING}
-
STATIC_HOST_master=https://cdn2.scratch.mit.edu
-
STATIC_HOST_master=https://cdn2.scratch.mit.edu
-
STATIC_HOST_STAGING=https://scratch.ly
-
STATIC_HOST_STAGING=https://
cdn.
scratch.ly
-
STATIC_HOST_VAR=STATIC_HOST_$TRAVIS_BRANCH
-
STATIC_HOST_VAR=STATIC_HOST_$TRAVIS_BRANCH
-
STATIC_HOST=${!STATIC_HOST_VAR}
-
STATIC_HOST=${!STATIC_HOST_VAR}
-
STATIC_HOST=${STATIC_HOST:-$STATIC_HOST_STAGING}
-
STATIC_HOST=${STATIC_HOST:-$STATIC_HOST_STAGING}
...
...
src/components/grid/grid.jsx
View file @
efd23ed8
...
@@ -4,6 +4,7 @@ const React = require('react');
...
@@ -4,6 +4,7 @@ const React = require('react');
const
Thumbnail
=
require
(
'
../thumbnail/thumbnail.jsx
'
);
const
Thumbnail
=
require
(
'
../thumbnail/thumbnail.jsx
'
);
const
FlexRow
=
require
(
'
../flex-row/flex-row.jsx
'
);
const
FlexRow
=
require
(
'
../flex-row/flex-row.jsx
'
);
const
thumbnailUrl
=
require
(
'
../../lib/user-thumbnail
'
);
require
(
'
./grid.scss
'
);
require
(
'
./grid.scss
'
);
...
@@ -15,7 +16,7 @@ const Grid = props => (
...
@@ -15,7 +16,7 @@ const Grid = props => (
if
(
props
.
itemType
===
'
projects
'
)
{
if
(
props
.
itemType
===
'
projects
'
)
{
return
(
return
(
<
Thumbnail
<
Thumbnail
avatar=
{
`https://cdn2.scratch.mit.edu/get_image/user/${item.author.id}_32x32.png`
}
avatar=
{
thumbnailUrl
(
item
.
author
.
id
)
}
creator=
{
item
.
author
.
username
}
creator=
{
item
.
author
.
username
}
favorites=
{
item
.
stats
.
favorites
}
favorites=
{
item
.
stats
.
favorites
}
href=
{
href
}
href=
{
href
}
...
...
src/components/thumbnailcolumn/thumbnailcolumn.jsx
View file @
efd23ed8
...
@@ -4,6 +4,7 @@ const React = require('react');
...
@@ -4,6 +4,7 @@ const React = require('react');
const
Thumbnail
=
require
(
'
../thumbnail/thumbnail.jsx
'
);
const
Thumbnail
=
require
(
'
../thumbnail/thumbnail.jsx
'
);
const
FlexRow
=
require
(
'
../flex-row/flex-row.jsx
'
);
const
FlexRow
=
require
(
'
../flex-row/flex-row.jsx
'
);
const
thumbnailUrl
=
require
(
'
../../lib/user-thumbnail
'
);
require
(
'
./thumbnailcolumn.scss
'
);
require
(
'
./thumbnailcolumn.scss
'
);
...
@@ -14,7 +15,7 @@ const ThumbnailColumn = props => (
...
@@ -14,7 +15,7 @@ const ThumbnailColumn = props => (
if
(
props
.
itemType
===
'
preview
'
)
{
if
(
props
.
itemType
===
'
preview
'
)
{
return
(
return
(
<
Thumbnail
<
Thumbnail
avatar=
{
`https://cdn2.scratch.mit.edu/get_image/user/${item.author.id}_32x32.png`
}
avatar=
{
thumbnailUrl
(
item
.
author
.
id
)
}
creator=
{
item
.
author
.
username
}
creator=
{
item
.
author
.
username
}
favorites=
{
item
.
stats
.
favorites
}
favorites=
{
item
.
stats
.
favorites
}
href=
{
href
}
href=
{
href
}
...
...
src/lib/user-thumbnail.js
View file @
efd23ed8
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
* @returns {string} thumbnail url string
* @returns {string} thumbnail url string
*/
*/
const
thumbnailUrl
=
(
userId
,
width
,
height
)
=>
(
const
thumbnailUrl
=
(
userId
,
width
,
height
)
=>
(
`
${
process
.
env
.
STATIC_HOST
}
/get_image/user/
${
userId
}
_`
+
`
${
process
.
env
.
STATIC_HOST
}
/get_image/user/
${
userId
||
'
default
'
}
_`
+
`
${
width
?
width
:
32
}
x
${
height
?
height
:
(
width
?
width
:
32
)}
.png`
`
${
width
?
width
:
32
}
x
${
height
?
height
:
(
width
?
width
:
32
)}
.png`
);
);
...
...
src/views/messages/message-rows/comment-message.jsx
View file @
efd23ed8
...
@@ -10,6 +10,7 @@ const React = require('react');
...
@@ -10,6 +10,7 @@ const React = require('react');
const
Comment
=
require
(
'
../../../components/comment/comment.jsx
'
);
const
Comment
=
require
(
'
../../../components/comment/comment.jsx
'
);
const
FlexRow
=
require
(
'
../../../components/flex-row/flex-row.jsx
'
);
const
FlexRow
=
require
(
'
../../../components/flex-row/flex-row.jsx
'
);
const
SocialMessage
=
require
(
'
../../../components/social-message/social-message.jsx
'
);
const
SocialMessage
=
require
(
'
../../../components/social-message/social-message.jsx
'
);
const
thumbnailUrl
=
require
(
'
../../../lib/user-thumbnail
'
);
class
CommentMessage
extends
React
.
Component
{
class
CommentMessage
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
...
@@ -164,7 +165,7 @@ class CommentMessage extends React.Component {
...
@@ -164,7 +165,7 @@ class CommentMessage extends React.Component {
<
img
<
img
alt=
{
`${this.props.actorUsername}'s avatar`
}
alt=
{
`${this.props.actorUsername}'s avatar`
}
className=
"comment-message-info-img"
className=
"comment-message-info-img"
src=
{
`https://cdn2.scratch.mit.edu/get_image/user/${this.props.actorId}_32x32.png`
}
src=
{
thumbnailUrl
(
this
.
props
.
actorId
)
}
/>
/>
</
a
>
</
a
>
<
Comment
<
Comment
...
...
src/views/preview/presentation.jsx
View file @
efd23ed8
...
@@ -25,6 +25,7 @@ const InplaceInput = require('../../components/forms/inplace-input.jsx');
...
@@ -25,6 +25,7 @@ const InplaceInput = require('../../components/forms/inplace-input.jsx');
const
TopLevelComment
=
require
(
'
./comment/top-level-comment.jsx
'
);
const
TopLevelComment
=
require
(
'
./comment/top-level-comment.jsx
'
);
const
ComposeComment
=
require
(
'
./comment/compose-comment.jsx
'
);
const
ComposeComment
=
require
(
'
./comment/compose-comment.jsx
'
);
const
ExtensionChip
=
require
(
'
./extension-chip.jsx
'
);
const
ExtensionChip
=
require
(
'
./extension-chip.jsx
'
);
const
thumbnailUrl
=
require
(
'
../../lib/user-thumbnail
'
);
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
require
(
'
./preview.scss
'
);
require
(
'
./preview.scss
'
);
...
@@ -111,7 +112,7 @@ const PreviewPresentation = ({
...
@@ -111,7 +112,7 @@ const PreviewPresentation = ({
<
a
href=
{
`/users/${projectInfo.author.username}`
}
>
<
a
href=
{
`/users/${projectInfo.author.username}`
}
>
<
Avatar
<
Avatar
alt=
{
projectInfo
.
author
.
username
}
alt=
{
projectInfo
.
author
.
username
}
src=
{
`https://cdn2.scratch.mit.edu/get_image/user/${projectInfo.author.id}_48x48.png`
}
src=
{
thumbnailUrl
(
projectInfo
.
author
.
id
,
48
)
}
/>
/>
</
a
>
</
a
>
<
div
className=
"title"
>
<
div
className=
"title"
>
...
...
src/views/preview/remix-credit.jsx
View file @
efd23ed8
...
@@ -3,6 +3,7 @@ const FormattedMessage = require('react-intl').FormattedMessage;
...
@@ -3,6 +3,7 @@ const FormattedMessage = require('react-intl').FormattedMessage;
const
FlexRow
=
require
(
'
../../components/flex-row/flex-row.jsx
'
);
const
FlexRow
=
require
(
'
../../components/flex-row/flex-row.jsx
'
);
const
Avatar
=
require
(
'
../../components/avatar/avatar.jsx
'
);
const
Avatar
=
require
(
'
../../components/avatar/avatar.jsx
'
);
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
const
projectShape
=
require
(
'
./projectshape.jsx
'
).
projectShape
;
const
thumbnailUrl
=
require
(
'
../../lib/user-thumbnail
'
);
const
RemixCredit
=
props
=>
{
const
RemixCredit
=
props
=>
{
const
projectInfo
=
props
.
projectInfo
;
const
projectInfo
=
props
.
projectInfo
;
...
@@ -11,7 +12,7 @@ const RemixCredit = props => {
...
@@ -11,7 +12,7 @@ const RemixCredit = props => {
<
FlexRow
className=
"remix-credit"
>
<
FlexRow
className=
"remix-credit"
>
<
Avatar
<
Avatar
className=
"remix"
className=
"remix"
src=
{
`https://cdn2.scratch.mit.edu/get_image/user/${projectInfo.author.id}_48x48.png`
}
src=
{
thumbnailUrl
(
projectInfo
.
author
.
id
,
48
)
}
/>
/>
<
div
className=
"credit-text"
>
<
div
className=
"credit-text"
>
<
FormattedMessage
<
FormattedMessage
...
...
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