From bc7b4409244e93c6faf6866fed8db0e3dd54657e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Sun, 7 Aug 2022 02:14:08 +0900 Subject: [PATCH] Display process time --- botanjs/src/Astro/Blog/Layout/MainFrame.js | 16 ++++++++++++++++ botanjs/src/Astro/Common/Element/Footer.css | 1 + 2 files changed, 17 insertions(+) diff --git a/botanjs/src/Astro/Blog/Layout/MainFrame.js b/botanjs/src/Astro/Blog/Layout/MainFrame.js index 2cdbd88..e689c17 100644 --- a/botanjs/src/Astro/Blog/Layout/MainFrame.js +++ b/botanjs/src/Astro/Blog/Layout/MainFrame.js @@ -54,6 +54,22 @@ navControl(); initBackgroundParallax(); initArchiveButtons(); + displayProcessTime(); + }; + + var displayProcessTime = function() + { + var ms = document.lastChild; + if( ms.nodeType == document.COMMENT_NODE && ms.textContent && ms.textContent.match( /^\d+$/ ) ) + { + ms = ( Number( ms.textContent ) * 1e-6 ).toFixed( 2 ) + "ms"; + var copysign = Dand.glass( "copysign" ); + if( copysign.length ) + { + copysign = copysign[0]; + copysign.insertBefore( Dand.wrap( "span", false, "ptime", ms ), copysign.firstChild ); + } + } }; var initArchiveButtons = function() diff --git a/botanjs/src/Astro/Common/Element/Footer.css b/botanjs/src/Astro/Common/Element/Footer.css index cd0b895..a35012b 100644 --- a/botanjs/src/Astro/Common/Element/Footer.css +++ b/botanjs/src/Astro/Common/Element/Footer.css @@ -33,4 +33,5 @@ footer { .copysign > a { color: #BBB; + vertical-align: middle; }