aboutsummaryrefslogtreecommitdiffstats
path: root/memo.js
diff options
context:
space:
mode:
authordrry2008-11-07 23:34:36 +0000
committerdrry2008-11-07 23:34:36 +0000
commit3e8d354c1199cb42298c69eff977a4b068246827 (patch)
tree8d43425adf01f704ddb60c3a5cc892df4f74aef3 /memo.js
parent26e7a3b656e1f9853cde1f7010afa3c21ffeaae5 (diff)
downloadvimperator-plugins-3e8d354c1199cb42298c69eff977a4b068246827.tar.bz2
* cosmetic changes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22978 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'memo.js')
-rw-r--r--memo.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/memo.js b/memo.js
index 33a96b4..0c6fb81 100644
--- a/memo.js
+++ b/memo.js
@@ -1,3 +1,4 @@
+// ==VimperatorPlugin==
// @name memo
// @description to write a memo
// @description-ja メモを書く
@@ -9,13 +10,13 @@
// ==/VimperatorPlugin==
//
// Usage:
-// :memo
+// :memo
// show the memo that was written.
// :memo fooooobar!
// write "fooooobar!" to the specified memo file.
//
// Usage-ja:
-// :memo
+// :memo
// 書かれたメモを表示する
// :memo fooooobar!
// "fooooobar!" と、メモに書く
@@ -27,18 +28,18 @@
(function () {
let localfilepath = liberator.globalVariables.memo_filepath || io.expandPath('~/.vimpmemo');
- let charset = 'UTF-8'
+ let charset = 'UTF-8';
//ネタ的
let lz = function(s,n)(s+'').replace(new RegExp('^.{0,'+(n-1)+'}$'),function(s)lz('0'+s,n));
function dateTime () {
with (new Date())
- return lz(getYear() + 1900, 4) + '/' +
- lz(getMonth(), 2) + '/' +
- lz(getDate(), 2) + ' ' +
+ return lz(getFullYear(), 4) + '/' +
+ lz(getMonth() + 1, 2) + '/' +
+ lz(getDate(), 2) + ' ' +
lz(getHours(), 2) + ':' +
- lz(getMinutes(), 2) ;
+ lz(getMinutes(), 2);
}
function filepath () {
@@ -53,7 +54,7 @@
let conv = Cc['@mozilla.org/intl/converter-output-stream;1'].
createInstance(Ci.nsIConverterOutputStream);
out.init(filepath(), 0x02 | 0x10 | 0x08, 0664, 0);
- conv.init(out, charset, line.length,
+ conv.init(out, charset, line.length,
Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
conv.writeString(line);
conv.close();