From 33408fd3a366a51a4676c4fe83c8f813281befb8 Mon Sep 17 00:00:00 2001 From: ruanyf Date: Fri, 3 Jan 2020 15:06:05 +0800 Subject: [PATCH] feat: add statistics code --- js/ditto.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/ditto.js b/js/ditto.js index 6d48b44..eb7f13c 100644 --- a/js/ditto.js +++ b/js/ditto.js @@ -316,6 +316,14 @@ function show_loading() { return loading; } +function statistics() { + var _hmt = _hmt || []; + var hm = document.createElement("script"); + hm.src = "https://hm.baidu.com/hm.js?519d72adb78a0bf66de7bae18e994322"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); +} + function router() { var path = location.hash.replace(/#([^#]*)(#.*)?/, './$1'); @@ -415,6 +423,8 @@ function router() { $('#pagedown').css('display', 'inline-block'); } + statistics(); + (function() { var $w = $(window); var $prog2 = $('.progress-indicator-2');