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

UI improvements #17

Merged
merged 10 commits into from
May 9, 2017
Merged

UI improvements #17

merged 10 commits into from
May 9, 2017

Conversation

simonhearne
Copy link
Contributor

No description provided.

app/public.js Outdated
@@ -259,12 +252,20 @@
}

function getSize(element) {
let performanceEntry = performance.getEntriesByName(getUrl(element))[0];
performanceEntry = performance.getEntriesByName(getUrl(element))[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne MAINTENANCE - use local variable instead of global use let

app/public.js Outdated
if (performanceEntry) {
return performanceEntry.encodedBodySize;
}
}

function getDuration(element) {
performanceEntry = performance.getEntriesByName(element)[0];
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne MAINTENANCE - use local variable instead of global use let

app/public.js Outdated
function getDuration(element) {
performanceEntry = performance.getEntriesByName(element)[0];
if (performanceEntry) {
console.log(performanceEntry);
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne MAINTENANCE - remove all console logs please

app/public.js Outdated

function getHost(s) {
let l = document.createElement('a');
l.href=s;
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne MAINTENANCE - use URL api

let url = new URL('http://test.google.com/after?bool')
return url.hostname;

This will exclude ports btw.

@@ -19,6 +19,7 @@
z-index: 999999 !important;
box-sizing: border-box !important;
padding: 5px !important;
font-size:90%;
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne CONSISTENCY - use consistent style with spaces after :

Copy link
Contributor

Choose a reason for hiding this comment

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

everywhere

app/public.js Outdated
return image.url;
}
function getImageScale(image) {
let wid = image.naturalSize.width / image.width;
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne MAINTENANCE - use readable variable names width, height

app/public.js Outdated
function getImageScale(image) {
let wid = image.naturalSize.width / image.width;
let hei = image.naturalSize.height / image.height;
return Math.max(wid,hei);
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne CONSISTENCY - space after comma

Copy link
Contributor

Choose a reason for hiding this comment

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

everywhere

app/public.js Outdated
@@ -281,6 +282,20 @@
}
}

function getName(s) {
let n = s.replace(/^.*[\\\/]/, '');
if (n.indexOf('?')>0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne INFO - are you sure you want to eliminate query strings? some sites use them to fetch different versions of the image.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just to render the filename in the overlay, removing query strings makes the filename more readable and the href is still available for the full image URL.

}
button {
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne CONSISTENCY - create a class. Don't target html tags directly.

@@ -14,6 +14,28 @@
limitations under the License.
*/

html, body {
/*width: 390px;*/
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne MAINTENANCE - remove comment

app/public.js Outdated

return COLORS.blue;
let col = percentage;
if (percentage < 0) col = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne CONSISTENCY - always use { for any if statements even if it's a single line

@andydavies andydavies mentioned this pull request May 5, 2017
app/popup.html Outdated
<button id="stop">Remove Overlay</button>
</div>
<div class="popup-contact">
<a href="https://www.nccgroup.trust/web-performance/" id="contact">Need help?</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

@simonhearne DoD - add target="_blank" as it doesn't open otherwise

@tabanliviu tabanliviu merged commit f6d139c into development May 9, 2017
@tabanliviu tabanliviu deleted the simon--popup-ui-improvements branch May 9, 2017 15:44
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.

None yet

2 participants