aboutsummaryrefslogtreecommitdiffstats
path: root/clock.js
diff options
context:
space:
mode:
authordrry2008-11-28 06:57:46 +0000
committerdrry2008-11-28 06:57:46 +0000
commit2691ed9e5bb7a2046cb2760ee0a54b71cbcce715 (patch)
tree353274da1cd616c84ee16b6ea4223743d8d90d48 /clock.js
parent21f69fb1adf5f8190ea7a709787499371cf080ff (diff)
downloadvimperator-plugins-2691ed9e5bb7a2046cb2760ee0a54b71cbcce715.tar.bz2
* 正規表現を修正・削減しました。
* ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25222 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'clock.js')
-rw-r--r--clock.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/clock.js b/clock.js
index 5474784..c25b504 100644
--- a/clock.js
+++ b/clock.js
@@ -4,7 +4,7 @@
* @description clock.
* @description-ja とけい。
* @author janus_wel <janus_wel@fb3.so-net.ne.jp>
- * @version 0.10
+ * @version 0.11
* @minversion 2.0pre
* @maxversion 2.0pre
* ==/VimperatorPlugin==
@@ -53,10 +53,10 @@
const format = liberator.globalVariables.clock_format || '[%t]';
const position = liberator.globalVariables.clock_position || 'liberator-commandline-command';
let atemp = liberator.globalVariables.clock_after;
-const after = (atemp === undefined) ? true
- : (/^false$/i.test(atemp)) ? false
- : (/^\d+$/i.test(atemp)) ? parseInt(atemp, 10)
- : true;
+const after = (atemp === undefined) ? true
+ : (atemp.toLowerCase() === 'false') ? false
+ : (/^\d+$/.test(atemp)) ? parseInt(atemp, 10)
+ : true;
// class definitions
function Clock() {
@@ -76,7 +76,7 @@ Clock.prototype = {
style: [
'margin: 0;',
'padding: 1px;',
- 'border: none;',
+ 'border: 0 none;',
'color: black;',
'background-color: white;',
'font-family: monospace;',
@@ -245,9 +245,7 @@ function day() {
return month + '/' + date;
}
function year() {
- let now = new Date();
- let year = (now.getYear() + 1900).toString(10);
- return year;
+ return new Date().getFullYear().toString(10);
}
// node control