diff options
| -rw-r--r-- | assets/js/miracles.min.js | 49 | ||||
| -rwxr-xr-x | libs/Options.php | 2 |
2 files changed, 25 insertions, 26 deletions
diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js index ca56a58..dff9298 100644 --- a/assets/js/miracles.min.js +++ b/assets/js/miracles.min.js @@ -403,30 +403,31 @@ function getWordsNum() { /**
* Build Time Echo
*/
-function startTime(time = '2010-01-01') {
- startTimeV = time;
- var $time = new Date().getTime() - new Date(startTimeV);
- if ($time < 0) return '0秒';
- let result = '';
- if ($time >= 365 * 86400000) {
- result += parseInt($time / (365 * 86400000)) + ' 年 ';
- $time = ($time % (365 * 86400000));
- }
- if ($time >= 86400000) {
- result += parseInt($time / 86400000) + ' 天 ';
- $time = ($time % 86400000);
- }
- if ($time >= 3600000) {
- result += parseInt($time / 3600000) + ' 小时 ';
- $time = ($time % 3600000);
- }
- if ($time >= 60000) {
- result += parseInt($time / 60000) + ' 分 ';
- $time = ($time % 60000);
- }
- result += parseInt($time / 1000) + ' 秒 ';
- $('#build-time').html(result);
- buildTimeout = setTimeout('startTime(startTimeV)', 1000)
+function startTime(a) {
+ var time = a;
+ startTimeV = time;
+ var b = new Date().getTime() - new Date(startTimeV);
+ if (b < 0) return '0 秒';
+ let result = '';
+ if (b >= 365 * 86400000) {
+ result += parseInt(b / (365 * 86400000)) + ' 年 ';
+ b = (b % (365 * 86400000))
+ }
+ if (b >= 86400000) {
+ result += parseInt(b / 86400000) + ' 天 ';
+ b = (b % 86400000)
+ }
+ if (b >= 3600000) {
+ result += parseInt(b / 3600000) + ' 小时 ';
+ b = (b % 3600000)
+ }
+ if (b >= 60000) {
+ result += parseInt(b / 60000) + ' 分 ';
+ b = (b % 60000)
+ }
+ result += parseInt(b / 1000) + ' 秒 ';
+ $('#build-time').html(result);
+ buildTimeout = setTimeout('startTime(startTimeV)', 1000)
}
/**
diff --git a/libs/Options.php b/libs/Options.php index 13ec8ea..21ece40 100755 --- a/libs/Options.php +++ b/libs/Options.php @@ -140,8 +140,6 @@ function themeConfig($form) { $form->addInput($CDN);
$ifShowRTA = new Typecho_Widget_Helper_Form_Element_Select('ifShowRTA',array('0'=>'不显示','1'=>'显示'),'0','阅读时长提示 RTA','在文章前加入阅读时长提示,增进用户体验');
$form->addInput($ifShowRTA);
- $postQR = new Typecho_Widget_Helper_Form_Element_Text('postQR', NULL, NULL, _t('自定义文章二维码 API'), _t('默认调用 topscan.com 的 API,你可以在这里输入其他的 API 地址,例如:https://api.qrserver.com/v1/create-qr-code/?size=230x230&data=<hr>'));
- $form->addInput($postQR);
//custom style
$grayTheme = new Typecho_Widget_Helper_Form_Element_Select('grayTheme',array('0'=>'关闭','1'=>'开启'),'0','<h2>个性化</h2>哀悼模式','打开后网站变为黑白');
|
