From 8d09e455b73baa731177ba9f7d0386eb1dd6ad67 Mon Sep 17 00:00:00 2001
From: anekos
Date: Mon, 1 Mar 2010 12:23:07 +0000
Subject: 前回と同じ内容の時は書き換えないようにした。(効果はあるのか?)
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@36889 d0d07461-0603-4401-acd4-de1884942a52
---
statstat.js | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
(limited to 'statstat.js')
diff --git a/statstat.js b/statstat.js
index dd5391f..f4006ab 100644
--- a/statstat.js
+++ b/statstat.js
@@ -1,5 +1,5 @@
/* NEW BSD LICENSE {{{
-Copyright (c) 2008-2009, anekos.
+Copyright (c) 2008-2010, anekos.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -39,7 +39,7 @@ let PLUGIN_INFO =
すた☆すた
Show information on statusline.
ステータスラインに情報を表示
- 1.0.1
+ 1.0.2
anekos
new BSD License (Please read the source code comments of this plugin)
修正BSDライセンス (ソースコードのコメントを参照してください)
@@ -56,7 +56,7 @@ let PLUGIN_INFO =
// }}}
// INFO {{{
let INFO =
-
@@ -108,10 +108,18 @@ let INFO =
stbar.insertBefore(panel, document.getElementById('liberator-statusline').nextSibling);
stat = liberator.plugins.statstat = {
+ previousText: null,
panel: panel,
label: label,
interval: 1000,
- set text (value) this.label.setAttribute('value', '<- ' + value + ' ->'),
+ set text (value) {
+ value = value.toString();
+ if (this.previousText === value)
+ return value;
+ this.label.setAttribute('value', '<- ' + value + ' ->');
+ this.previousText = value;
+ return value;
+ },
action: function () new Date().toLocaleString(),
execute: function () (this.text = this.action.apply(this, arguments)),
run: function () {
--
cgit v1.2.3