From 2691ed9e5bb7a2046cb2760ee0a54b71cbcce715 Mon Sep 17 00:00:00 2001 From: drry Date: Fri, 28 Nov 2008 06:57:46 +0000 Subject: * 正規表現を修正・削減しました。 * ほか。 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@25222 d0d07461-0603-4401-acd4-de1884942a52 --- clock.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'clock.js') 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 - * @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 -- cgit v1.2.3