Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few fixes #128

Merged
merged 15 commits into from
Mar 16, 2017
Merged

Few fixes #128

merged 15 commits into from
Mar 16, 2017

Conversation

ImMorpheus
Copy link
Contributor

@ImMorpheus ImMorpheus commented Mar 11, 2017

Few fixes (wip)

@ImMorpheus ImMorpheus changed the title Switch to https Few fixes Mar 11, 2017
Copy link
Contributor

@jamierocks jamierocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be commented on our OCD issue.

@@ -39,7 +39,7 @@
<header>
<div class="container">
<div class="logo">
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" />
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" alt="Spongie reverse"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really isn't required, not going to help accessibility at all.

@@ -55,7 +55,7 @@
<div class="container">
<div id="sp-logo-container" class="page-scroll">
<a class="logo" href="#top">
<img src="assets/img/icons/spongie-mark.svg" style="height: 40px">
<img src="assets/img/icons/spongie-mark.svg" alt="Spongie" style="height: 40px">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really isn't required, not going to help accessibility at all.

@@ -30,7 +30,7 @@
<div class="row">
<div class="col-lg-5 col-md-6">
<div class="logo">
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" />
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" alt="Spongie reverse" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really isn't required, not going to help accessibility at all.

@@ -30,7 +30,7 @@
<div class="row">
<div class="col-lg-5 col-md-6">
<div class="logo">
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" />
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" alt="Spongie reverse"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really isn't required, not going to help accessibility at all.

@ImMorpheus
Copy link
Contributor Author

ImMorpheus commented Mar 12, 2017

The alt attribute is required for img tag. However if you really don't like the content we can use empty alt.

Edit: I forgot about the ocd list, thanks for that

@ImMorpheus ImMorpheus changed the title Few fixes [WIP] Few fixes Mar 12, 2017
@jamierocks
Copy link
Contributor

Yes they should have an empty alt

@jamierocks
Copy link
Contributor

As of HTML5 self-closed tags (such as img) no longer need to use specific syntax (/>), and can just be left as a single tag.

@ImMorpheus
Copy link
Contributor Author

Note: currently I had to add in the CSP connect-src for the download page and frame-src for kiwilrc. Everything works, if we want to make it more restrictive we can move the fonts on the server and use font-src 'self'

@jamierocks
Copy link
Contributor

if we want to make it more restrictive we can move the fonts on the server and use font-src 'self'

That'd be overkill

@jamierocks
Copy link
Contributor

Not to demean your pr, but these changes are the type of things that an OCD issue exists for in every SpongePowered repository (SpongeHome issue) for.

Perhaps exception can be made of this pr, in light of the number of issues resolved - however in future that is certainly where these issues should be documented.

@ImMorpheus
Copy link
Contributor Author

Yeah, you've already said that (and I added the issues to the OCD list), but if you really want to fix them I can delete the pull request and no 'exception' will be made.
That being said, I fixed a few things and created this pull because I knew changes would be over 20 lines. Thank goodness small pull request get closed and people informed they should use the OCD.

@jamierocks
Copy link
Contributor

Thank goodness small pull request get closed and people informed they should use the OCD.

In regards to that pr, I am not sure why that was merged and not directed to the OCD issue. It should have been.

"style-src 'self' 'unsafe-inline' https:; "+
"script-src 'self' 'unsafe-eval' https://cdnjs.cloudflare.com https://www.google-analytics.com; "+
"frame-ancestors 'none'")*/
header.Set("Content-Security-Policy", "default-src 'none'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://cdnjs.cloudflare.com/ ; style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com; img-src 'self'; font-src https://cdnjs.cloudflare.com/ https://fonts.googleapis.com/; connect-src 'self' https://dl-api.spongepowered.org/; frame-src https://kiwiirc.com; frame-ancestors 'none'; upgrade-insecure-requests; block-all-mixed-content; ")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get this split over a few lines, to promote readability?

@@ -39,7 +39,7 @@
<header>
<div class="container">
<div class="logo">
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" />
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" alt=""/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change /> for > as per HTML5.

@@ -129,7 +129,7 @@
<p>Copyright &copy; SpongePowered 2014-2017</p>
<p id="fastly">Accelerated by<br>
<a href="https://www.fastly.com">
<img src="assets/img/fastly.png" alt="Fastly" />
<img src="assets/img/fastly.png" alt="Fastly" height="45" width="100" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change /> for > as per HTML5.

@@ -30,7 +30,7 @@
<div class="row">
<div class="col-lg-5 col-md-6">
<div class="logo">
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" />
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" alt="" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change /> for > as per HTML5.

@@ -30,7 +30,7 @@
<div class="row">
<div class="col-lg-5 col-md-6">
<div class="logo">
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" />
<img src="assets/img/icons/spongie-mark-reverse-dark.svg" alt=""/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change /> for > as per HTML5.

README.md Outdated
under the MIT license. See [LICENSE.md](LICENSE.md) for details.

### Branches

- `master` is hooked up to [www staging](https://www-staging.spongepowered.org/)
- `production` is hooked up to [www prod](https://www.spongepowered.org/)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The production branch is no longer used - master is now www prod.

.gitignore Outdated
@@ -80,13 +80,13 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May as well remove Grunt from the gitignore - we don't use it.

Copy link
Contributor Author

@ImMorpheus ImMorpheus Mar 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that okay ? You created that gitignore with gitignore.io, it is basically a preset which handle multiple developers using different ide/tools/etc

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah - Grunt is a buildtool, we use Gulp so Grunt will never become part of our dev env.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.gitignore Outdated
@@ -80,13 +80,10 @@ lib-cov
# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no reason to remove this. The gitignore is based on a template and since this isn't breaking anything in our project I see no reason to remove it.

Copy link
Contributor Author

@ImMorpheus ImMorpheus Mar 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I knew it would end up this way

.gitignore Outdated
# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to suggest this change in the upstream repository: https://github.com/github/gitignore/blob/master/Node.gitignore#L32. I don't see a reason to change it here.

"style-src 'self' 'unsafe-inline' https:; "+
"script-src 'self' 'unsafe-eval' https://cdnjs.cloudflare.com https://www.google-analytics.com; "+
"frame-ancestors 'none'")*/
header.Set("Content-Security-Policy", "default-src 'none'; " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to a separate PR, it needs careful testing and can't be accepted together with the other minor changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok, I didn't open a new pull because it was a rather small fix (in terms of lines)

@@ -49,3 +49,54 @@ func AddHeaders(resp http.ResponseWriter) {
header.Add(fastly.SurrogateControlHeader, cache.SurrogateStaticContentOptions)
}
}
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not what you wanted to do :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I noticed that soon after

@kashike
Copy link

kashike commented Mar 13, 2017

You should not be changing any of the sponsor images. 🙅‍♂️

@ImMorpheus
Copy link
Contributor Author

ImMorpheus commented Mar 13, 2017

I just compressed the images, can't I do that ? (Not a sensitive change, but now they are compressed)
Also, is the backgroud included in the group of images I shouldn't change ?

@stephan-gh
Copy link
Contributor

@ImMorpheus It's probably better if we keep them as-is, because they were not made by us. Regarding the background, it seems like your optimized image has the same size as the original one?

@ImMorpheus
Copy link
Contributor Author

Ok, I didn't know that. Consider it fixed
The backgroud image is 1% smaller, we are talking about nearly 500B (that's why I thought it was not a big deal)

@ImMorpheus ImMorpheus changed the title [WIP] Few fixes Few fixes Mar 15, 2017
@stephan-gh
Copy link
Contributor

@ImMorpheus 500 bytes isn't really worth changing the image, that is almost nothing.

@@ -129,7 +129,7 @@
<p>Copyright &copy; SpongePowered 2014-2017</p>
<p id="fastly">Accelerated by<br>
<a href="https://www.fastly.com">
<img src="assets/img/fastly.png" alt="Fastly" />
<img src="assets/img/fastly.png" alt="Fastly" height="45" width="100">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add an explicit width/height?

Copy link
Contributor Author

@ImMorpheus ImMorpheus Mar 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If height and width are set, the space required for the image is reserved when the page is loaded. Thus, the page loads faster.

@ImMorpheus
Copy link
Contributor Author

Yeah, I compressed the images all together and there was a compression of more than 20% with some of the others. It just happened to be there and was compressed

@stephan-gh
Copy link
Contributor

@ImMorpheus That's fine but please revert the change. We shouldn't require all clients to download the whole image again just for 500 bytes.

@ImMorpheus
Copy link
Contributor Author

Done

@stephan-gh stephan-gh self-assigned this Mar 16, 2017
@stephan-gh stephan-gh merged commit 580fc3f into SpongePowered:master Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants