From e9504b1fc6aed52d9ca49e31e8f99d1a1364718b Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 28 May 2015 10:34:07 -0500 Subject: [PATCH] * performance API and color changes on affilate page --- .../javascripts/everywhere/everywhere.js | 62 +++++++++++++++++++ .../landings/affiliate_program.css.scss | 7 +++ .../landings/partner_agreement_v1.css.scss | 6 +- 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/web/app/assets/javascripts/everywhere/everywhere.js b/web/app/assets/javascripts/everywhere/everywhere.js index 1b27ba754..f79494f42 100644 --- a/web/app/assets/javascripts/everywhere/everywhere.js +++ b/web/app/assets/javascripts/everywhere/everywhere.js @@ -20,6 +20,8 @@ var stun = null; var rest = context.JK.Rest(); + $(window).on('load', sendTimingResults) + $(window).on('pagehide', setNavigationStart) $(document).on('JAMKAZAM_CONSTRUCTED', function(e, data) { @@ -245,4 +247,64 @@ } } + function setNavigationStart() { + if(!window.performance || !window.performance.timing) { + try { + window.sessionStorage.setItem('navigationStart', Date.now()) + } + catch(e) { + logger.debug("unable to accesss sessionStorage") + } + } + + } + + + // http://githubengineering.com/browser-monitoring-for-github-com/ + function sendTimingResults() { + setTimeout(function() { + var timing; + var hasTimingApi; + + if(window.performance && window.performance.timing) { + timing = window.performance.timing + hasTimingApi = true; + } + else { + timing = {} + hasTimingApi = false; + } + + // Merge in simulated cross-browser load event + timing['crossBrowserLoadEvent'] = Date.now() + + var chromeFirstPaintTime; + if(window.chrome && window.chrome.loadTimes) { + var loadTimes = window.chrome.loadTimes() + if(loadTimes) { + chromeFirstPaintTime = true; + } + } + + // firstPaintTime is in seconds; convert to milliseconds to match performance.timing. + timing['chromeFirstPaintTime'] = Math.round(chromeFirstPaintTime * 1000); + + // Merge in simulated navigation start, if no navigation timing + if (!hasTimingApi) { + try { + var navStart = window.sessionStorage.getItem('navigationStart') + if(navStart) { + timing['simulatedNavigationStart'] = parseInt(navStart, 10) + } + } + catch(e) { } + } + + + //GitHub.reportStats timing + logger.debug("timing", timing) + }, 0) + + } + })(window, jQuery); diff --git a/web/app/assets/stylesheets/landings/affiliate_program.css.scss b/web/app/assets/stylesheets/landings/affiliate_program.css.scss index 2bfdeeccd..f695f5da7 100644 --- a/web/app/assets/stylesheets/landings/affiliate_program.css.scss +++ b/web/app/assets/stylesheets/landings/affiliate_program.css.scss @@ -3,6 +3,11 @@ body.web.landing_page.full { &.affiliate_program { + .video-container { + width:100%; + padding-bottom:53.33%; + + } .agree-disagree-buttons { margin-top:30px; } @@ -28,7 +33,9 @@ body.web.landing_page.full { h1 { display: inline-block; + margin-bottom:20px; } + .column { @include border_box_sizing; width:50% ! important; diff --git a/web/app/assets/stylesheets/landings/partner_agreement_v1.css.scss b/web/app/assets/stylesheets/landings/partner_agreement_v1.css.scss index 6f1756204..4adb0e548 100644 --- a/web/app/assets/stylesheets/landings/partner_agreement_v1.css.scss +++ b/web/app/assets/stylesheets/landings/partner_agreement_v1.css.scss @@ -1,7 +1,11 @@ #partner-agreement-v1 { + background-color:#eee; * { - color:#CCCCCC ! important; + color:black! important; + background-color:#eee; + font-family: Raleway, Arial, Helvetica, sans-serif ! important; + font-weight: 300 ! important; } .c1, .c20 {