From b972422cc6d58761f02114004c679e2d4dbbdd09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20M=C3=A9tais?= Date: Wed, 17 Jan 2018 10:21:11 -0600 Subject: [PATCH] Getting ready for HTTPS & HTTP/2 --- README.md | 2 +- front/src/js/controllers/dashboardCtrl.js | 4 ++-- front/src/js/directives/offendersDirectives.js | 11 +++++++++++ front/src/main.html | 8 ++++---- front/src/views/rule.html | 6 +++--- package.json | 2 +- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 85b2675d..4b541b1f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Analyzes a webpage and detects **performance** or **front-end code quality** iss The online tool (recommended): - http://yellowlab.tools + https://yellowlab.tools diff --git a/front/src/js/controllers/dashboardCtrl.js b/front/src/js/controllers/dashboardCtrl.js index b8f21155..76aab212 100644 --- a/front/src/js/controllers/dashboardCtrl.js +++ b/front/src/js/controllers/dashboardCtrl.js @@ -41,11 +41,11 @@ dashboardCtrl.controller('DashboardCtrl', ['$scope', '$rootScope', '$routeParams }; $scope.shareOnTwitter = function(message) { - openSocialPopup('https://twitter.com/intent/tweet?text=' + encodeURIComponent(message + 'http://yellowlab.tools')); + openSocialPopup('https://twitter.com/intent/tweet?text=' + encodeURIComponent(message + 'https://yellowlab.tools')); }; $scope.shareOnLinkedin = function(message) { - openSocialPopup('https://www.linkedin.com/shareArticle?mini=true&url=http://yellowlab.tools&title=' + encodeURIComponent(message) + '&summary=' + encodeURIComponent('YellowLabTools is a free online tool that analyzes performance and front-end quality of a webpage.')); + openSocialPopup('https://www.linkedin.com/shareArticle?mini=true&url=https://yellowlab.tools&title=' + encodeURIComponent(message) + '&summary=' + encodeURIComponent('YellowLabTools is a free online tool that analyzes performance and front-end quality of a webpage.')); }; function openSocialPopup(url) { diff --git a/front/src/js/directives/offendersDirectives.js b/front/src/js/directives/offendersDirectives.js index f9d747e4..434598ab 100644 --- a/front/src/js/directives/offendersDirectives.js +++ b/front/src/js/directives/offendersDirectives.js @@ -924,4 +924,15 @@ }; }); + // Proxify an HTTP image to HTTPS if hosted on HTTPS + // Uses a great free open-source external service: https://images.weserv.nl + offendersDirectives.filter('https', function() { + return function(url) { + if (url && url.indexOf('http://') === 0 && window.location.protocol === 'https:') { + return 'https://images.weserv.nl/?url=' + encodeURIComponent(url.substr(7)); + } + return url; + }; + }); + })(); diff --git a/front/src/main.html b/front/src/main.html index fce557d9..eec3f077 100644 --- a/front/src/main.html +++ b/front/src/main.html @@ -18,10 +18,10 @@ - - - - + + + + diff --git a/front/src/views/rule.html b/front/src/views/rule.html index f011a2a0..8238c17c 100644 --- a/front/src/views/rule.html +++ b/front/src/views/rule.html @@ -133,7 +133,7 @@

- + @@ -267,7 +267,7 @@

{{rule.value | bytes}} could be saved on
Current file: -
+

Current weight: {{image.original | bytes}}

@@ -364,7 +364,7 @@

-
+
{{request.size}}

diff --git a/package.json b/package.json index cbdea7d3..2406783f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": { "name": "Gaël Métais", "email": "gael@gaelmetais.com", - "url": "http://www.gaelmetais.com" + "url": "https://www.gaelmetais.com" }, "repository": { "type": "git",