From 3778dfb243f120f4cd0faec0440327add6d076d1 Mon Sep 17 00:00:00 2001 From: Yaacov Date: Tue, 7 Mar 2023 01:08:34 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=A8=20feat(result):=20show=20full=20U?= =?UTF-8?q?RL,=20not=20only=20hostname?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/js/components/SiteAnalysisResult.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/components/SiteAnalysisResult.js b/assets/js/components/SiteAnalysisResult.js index 10cb151c..0a200f0e 100644 --- a/assets/js/components/SiteAnalysisResult.js +++ b/assets/js/components/SiteAnalysisResult.js @@ -197,7 +197,7 @@ class SiteAnalysisResult { let formatedValue; // Format date formatedValue = this._getValidDateString(elementValue); - formatedValue = formatedValue ? formatedValue : getUrlHostName(elementValue); + formatedValue = formatedValue ? formatedValue : elementValue; return formatedValue ? formatedValue : elementValue; } From 0d5fdd47d154504a7d1c396e424e02aa8b5b582e Mon Sep 17 00:00:00 2001 From: Bastien Gatellier Date: Sun, 3 Dec 2023 18:28:41 +0100 Subject: [PATCH 2/5] feat: keep the URL on 1 line, but truncate it --- assets/css/51_page-result.css | 26 +++++++++++++++++++++ assets/js/components/SiteAnalysisResult.js | 12 ++++++++++ content/en/result/_#first_intro.md | 2 +- content/fr/result/_#first_intro.md | 4 ++-- layouts/partials/components/result-url.html | 2 +- 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/assets/css/51_page-result.css b/assets/css/51_page-result.css index df860a28..5b3ba29f 100644 --- a/assets/css/51_page-result.css +++ b/assets/css/51_page-result.css @@ -2,6 +2,32 @@ * RESULT PAGE SPECIFIC STYLES */ + .result-url-wrapper { + font-weight: var(--font-weight-bold); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + /** + * For small screens, put the URL on a new line, + * and move truncate feature from the wrapper to the URL. + */ + @media (max-width: 60rem) { + .result-url-wrapper { + overflow: auto; + text-overflow: initial; + white-space: initial; + } + + .result-url { + display: block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + /*! purgecss start ignore */ .result-badge { font-size: var(--s2); diff --git a/assets/js/components/SiteAnalysisResult.js b/assets/js/components/SiteAnalysisResult.js index 0a200f0e..c71e2d8f 100644 --- a/assets/js/components/SiteAnalysisResult.js +++ b/assets/js/components/SiteAnalysisResult.js @@ -115,6 +115,7 @@ class SiteAnalysisResult { this._setDomContent(pageResultData, "data-int", "data-int-attr"); // specific components updates + this._updateUrl(pageResultData.url) this._updateNoteChart(pageResultData.grade); this._updateFootprintResultsFromSelect(); this._updatetResultRangeSliders(pageResultData); @@ -260,5 +261,16 @@ class SiteAnalysisResult { const sliderEls = document.querySelectorAll(".js-rlr"); sliderEls.forEach((sliderEl) => new ResultRangeSlider({ sliderEl, data })); } + + /** + * Update the href and title attribute of the element that contains the analyzed URL + * @param {string} url + */ + _updateUrl(url) { + const urlElement = this.el.querySelector(".result-url") + + urlElement.setAttribute("href", url) + urlElement.setAttribute("title", url) + } } export default SiteAnalysisResult; diff --git a/content/en/result/_#first_intro.md b/content/en/result/_#first_intro.md index f06b3d2a..129e3b6e 100644 --- a/content/en/result/_#first_intro.md +++ b/content/en/result/_#first_intro.md @@ -5,6 +5,6 @@ widget="result-intro" Calculated on {{< result-date >}} -

+

Results for {{< result-url >}}

diff --git a/content/fr/result/_#first_intro.md b/content/fr/result/_#first_intro.md index 2cf44282..018d318d 100644 --- a/content/fr/result/_#first_intro.md +++ b/content/fr/result/_#first_intro.md @@ -5,6 +5,6 @@ widget="result-intro" Calculé le {{< result-date >}} -

-Résultat pour {{< result-url >}} +

+ Résultat pour {{< result-url >}}

diff --git a/layouts/partials/components/result-url.html b/layouts/partials/components/result-url.html index c1451ff9..77533a1a 100644 --- a/layouts/partials/components/result-url.html +++ b/layouts/partials/components/result-url.html @@ -1 +1 @@ - + From f99f2fc1240f6f9d12ddf3d27a0845227aac3fc7 Mon Sep 17 00:00:00 2001 From: Bastien Gatellier Date: Wed, 3 Jan 2024 14:25:44 +0100 Subject: [PATCH 3/5] feat: use input instead of truncate the URL --- content/en/result/_#first_intro.md | 6 ++++-- content/fr/result/_#first_intro.md | 6 +++--- layouts/partials/components/result-url.html | 16 +++++++++++++++- layouts/partials/widgets/result-intro.html | 12 ------------ 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/content/en/result/_#first_intro.md b/content/en/result/_#first_intro.md index 129e3b6e..2a675d1d 100644 --- a/content/en/result/_#first_intro.md +++ b/content/en/result/_#first_intro.md @@ -3,8 +3,10 @@ id="intro" widget="result-intro" +++ -Calculated on {{< result-date >}} +Calculated

-Results for {{< result-url >}} + Results from {{< result-date >}}

+ +{{< result-url >}} \ No newline at end of file diff --git a/content/fr/result/_#first_intro.md b/content/fr/result/_#first_intro.md index 018d318d..6c6415ff 100644 --- a/content/fr/result/_#first_intro.md +++ b/content/fr/result/_#first_intro.md @@ -3,8 +3,8 @@ id="intro" widget="result-intro" +++ -Calculé le {{< result-date >}} -

- Résultat pour {{< result-url >}} + Résultat du {{< result-date >}}

+ +{{< result-url >}} \ No newline at end of file diff --git a/layouts/partials/components/result-url.html b/layouts/partials/components/result-url.html index 77533a1a..a990432a 100644 --- a/layouts/partials/components/result-url.html +++ b/layouts/partials/components/result-url.html @@ -1 +1,15 @@ - +

+ + + {{ partial "svg/inline-svg-use" "icon-refresh" }} {{ i18n `ReTest` }} + {{ partial "svg/inline-svg-use" "icon-share" }} {{ i18n `Share` }} + +

diff --git a/layouts/partials/widgets/result-intro.html b/layouts/partials/widgets/result-intro.html index 9e36c4e5..6b9f8d01 100644 --- a/layouts/partials/widgets/result-intro.html +++ b/layouts/partials/widgets/result-intro.html @@ -7,18 +7,6 @@ >{{ partial "svg/inline-svg-use" "icon-arrow-left" }} {{ i18n `Back` }} -
From 9e334fb2cf80948529324b22d467388378887ef7 Mon Sep 17 00:00:00 2001 From: Bastien Gatellier Date: Sat, 3 Feb 2024 20:55:22 +0100 Subject: [PATCH 4/5] feat: use an input to display the URL in --- assets/css/51_page-result.css | 26 --------------------- assets/js/components/SiteAnalysisResult.js | 3 +-- content/en/result/_#first_intro.md | 6 ++--- content/fr/result/_#first_intro.md | 6 +++-- layouts/partials/components/result-url.html | 16 +------------ layouts/partials/widgets/result-intro.html | 13 +++++++++++ 6 files changed, 22 insertions(+), 48 deletions(-) diff --git a/assets/css/51_page-result.css b/assets/css/51_page-result.css index 5b3ba29f..df860a28 100644 --- a/assets/css/51_page-result.css +++ b/assets/css/51_page-result.css @@ -2,32 +2,6 @@ * RESULT PAGE SPECIFIC STYLES */ - .result-url-wrapper { - font-weight: var(--font-weight-bold); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - - /** - * For small screens, put the URL on a new line, - * and move truncate feature from the wrapper to the URL. - */ - @media (max-width: 60rem) { - .result-url-wrapper { - overflow: auto; - text-overflow: initial; - white-space: initial; - } - - .result-url { - display: block; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - } - /*! purgecss start ignore */ .result-badge { font-size: var(--s2); diff --git a/assets/js/components/SiteAnalysisResult.js b/assets/js/components/SiteAnalysisResult.js index c71e2d8f..84b6746d 100644 --- a/assets/js/components/SiteAnalysisResult.js +++ b/assets/js/components/SiteAnalysisResult.js @@ -269,8 +269,7 @@ class SiteAnalysisResult { _updateUrl(url) { const urlElement = this.el.querySelector(".result-url") - urlElement.setAttribute("href", url) - urlElement.setAttribute("title", url) + urlElement.setAttribute("value", url) } } export default SiteAnalysisResult; diff --git a/content/en/result/_#first_intro.md b/content/en/result/_#first_intro.md index 2a675d1d..b5af5c4d 100644 --- a/content/en/result/_#first_intro.md +++ b/content/en/result/_#first_intro.md @@ -3,10 +3,10 @@ id="intro" widget="result-intro" +++ -Calculated +Calculated on {{< result-date >}} -

- Results from {{< result-date >}} +

+ Analysis results

{{< result-url >}} \ No newline at end of file diff --git a/content/fr/result/_#first_intro.md b/content/fr/result/_#first_intro.md index 6c6415ff..5c70772c 100644 --- a/content/fr/result/_#first_intro.md +++ b/content/fr/result/_#first_intro.md @@ -3,8 +3,10 @@ id="intro" widget="result-intro" +++ -

- Résultat du {{< result-date >}} +Calculé le {{< result-date >}} + +

+ Résultats de l’analyse

{{< result-url >}} \ No newline at end of file diff --git a/layouts/partials/components/result-url.html b/layouts/partials/components/result-url.html index a990432a..fb444e70 100644 --- a/layouts/partials/components/result-url.html +++ b/layouts/partials/components/result-url.html @@ -1,15 +1 @@ -

- - - {{ partial "svg/inline-svg-use" "icon-refresh" }} {{ i18n `ReTest` }} - {{ partial "svg/inline-svg-use" "icon-share" }} {{ i18n `Share` }} - -

+ \ No newline at end of file diff --git a/layouts/partials/widgets/result-intro.html b/layouts/partials/widgets/result-intro.html index 6b9f8d01..3e58e07e 100644 --- a/layouts/partials/widgets/result-intro.html +++ b/layouts/partials/widgets/result-intro.html @@ -7,6 +7,19 @@ >{{ partial "svg/inline-svg-use" "icon-arrow-left" }} {{ i18n `Back` }}
+ +
From 11f51d6d47316ed7f2c972aa7929f3d20c6a78f4 Mon Sep 17 00:00:00 2001 From: Bastien Gatellier Date: Thu, 8 Feb 2024 20:52:43 +0100 Subject: [PATCH 5/5] feat: disable the input to allo copy only --- layouts/partials/components/result-url.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/components/result-url.html b/layouts/partials/components/result-url.html index fb444e70..753921b6 100644 --- a/layouts/partials/components/result-url.html +++ b/layouts/partials/components/result-url.html @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file