Skip to content

Commit

Permalink
corrected ES6 constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Mrowetz committed Apr 12, 2015
1 parent b977d84 commit 617955e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/components/navigationTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var navigationTimelineComponent = {};

navigationTimelineComponent.init = function(){

let startTime = data.perfTiming.navigationStart;
const startTime = data.perfTiming.navigationStart;
var perfTimingCalc = {
"pageLoadTime" : data.perfTiming.loadEventEnd - data.perfTiming.navigationStart,
"output" : []
Expand Down Expand Up @@ -76,7 +76,7 @@ navigationTimelineComponent.init = function(){
});

var setupTimeLine = function(){
let unit = perfTimingCalc.pageLoadTime / 100,
const unit = perfTimingCalc.pageLoadTime / 100,
barsToShow = perfTimingCalc.blocks
.filter((block) => (typeof block.start == "number" && typeof block.total == "number"))
.sort((a, b) => (a.start||0) - (b.start||0)),
Expand Down Expand Up @@ -243,7 +243,7 @@ navigationTimelineComponent.init = function(){
timeLineHolder.appendChild(renderMarks());

barsToShow.forEach(function(block, i){
let blockWidth = block.total||1,
const blockWidth = block.total||1,
y = 25 * i;

timeLineHolder.appendChild(createRect(blockWidth, 25, block.start||0.001, y, block.colour, block.name + " (" + block.start + "ms - " + block.end + "ms | total: " + block.total + "ms)"));
Expand Down
6 changes: 3 additions & 3 deletions src/components/resourcesTimeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ resourcesTimelineComponent.init = function(){
calc.loadDuration = Math.round(calc.lastResponseEnd);

var setupTimeLine = function(durationMs, blocks){
let unit = durationMs / 100,
const unit = durationMs / 100,
barsToShow = blocks
.filter((block) => (typeof block.start == "number" && typeof block.total == "number"))
.sort((a, b) => (a.start||0) - (b.start||0)),
Expand Down Expand Up @@ -172,8 +172,8 @@ resourcesTimelineComponent.init = function(){
var targetRect = evt.target;
dom.addClass(targetRect, "active");

let xPosEnd = targetRect.x.baseVal.valueInSpecifiedUnits + targetRect.width.baseVal.valueInSpecifiedUnits + "%";
let xPosStart = targetRect.x.baseVal.valueInSpecifiedUnits + "%";
const xPosEnd = targetRect.x.baseVal.valueInSpecifiedUnits + targetRect.width.baseVal.valueInSpecifiedUnits + "%";
const xPosStart = targetRect.x.baseVal.valueInSpecifiedUnits + "%";

endline.x1.baseVal.valueAsString = xPosEnd;
endline.x2.baseVal.valueAsString = xPosEnd;
Expand Down
2 changes: 1 addition & 1 deletion src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ data.allResourcesCalc = data.resources
.filter((currR) => !currR.name.match(/http[s]?\:\/\/(micmro|nurun).github.io\/performance-bookmarklet\/.*/))
.map((currR, i, arr) => {
//crunch the resources data into something easier to work with
let isRequest = currR.name.indexOf("http") === 0;
const isRequest = currR.name.indexOf("http") === 0;
var urlFragments, maybeFileName, fileExtension;

if(isRequest){
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ helper.getFileType = function(fileExtension, initiatorType){
};

helper.getRandomColor = function(baseRangeRed, baseRangeGreen, baseRangeBlue){
let range = [
const range = [
baseRangeRed||"0123456789ABCDEF",
baseRangeGreen||"0123456789ABCDEF",
baseRangeBlue||"0123456789ABCDEF"
Expand All @@ -73,7 +73,7 @@ helper.endsWith = function(str, suffix){
};

var getColourVariation = function(hexColour, variation){
let r = ((parseInt(hexColour.substr(1,2), 16)) + variation).toString(16),
const r = ((parseInt(hexColour.substr(1,2), 16)) + variation).toString(16),
g = ((parseInt(hexColour.substr(3,2), 16)) + variation).toString(16),
b = ((parseInt(hexColour.substr(5,2), 16)) + variation).toString(16);
return "#" + r + g + b;
Expand Down
8 changes: 4 additions & 4 deletions src/helpers/pieChartHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import dom from "../helpers/dom";

var pieChartHelpers = {};

let unit = (Math.PI * 2) / 100;
const unit = (Math.PI * 2) / 100;

var createWedge = function(id, size, startAngle, percentage, labelTxt, colour){
let radius = size/2,
const radius = size/2,
endAngle = startAngle + (percentage * unit - 0.001),
labelAngle = startAngle + (percentage/2 * unit - 0.001),
x1 = radius + radius * Math.sin(startAngle),
Expand Down Expand Up @@ -60,8 +60,8 @@ var createWedge = function(id, size, startAngle, percentage, labelTxt, colour){
};


let chartMaxHeight = (() => {
let contentWidth = (window.innerWidth * 0.98 - 64);
const chartMaxHeight = (() => {
const contentWidth = (window.innerWidth * 0.98 - 64);
if(contentWidth < 700){
return 350;
} else if(contentWidth < 800){
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ svg.getNodeTextWidth = function(textNode){
tmp.appendChild(textNode);
getOutputIFrame().body.appendChild(tmp);

let nodeWidth = textNode.getBBox().width;
const nodeWidth = textNode.getBBox().width;
tmp.parentNode.removeChild(tmp);
return nodeWidth;
};
Expand Down

0 comments on commit 617955e

Please sign in to comment.