aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordrry2008-11-07 23:34:36 +0000
committerdrry2008-11-07 23:34:36 +0000
commit3e8d354c1199cb42298c69eff977a4b068246827 (patch)
tree8d43425adf01f704ddb60c3a5cc892df4f74aef3
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
-rw-r--r--bitly.js14
-rw-r--r--memo.js17
2 files changed, 15 insertions, 16 deletions
diff --git a/bitly.js b/bitly.js
index 28fa211..08d004c 100644
--- a/bitly.js
+++ b/bitly.js
@@ -12,15 +12,15 @@
function bitly (uri, callback) {
let req = new XMLHttpRequest();
- req.onreadystatechange = function(){
+ req.onreadystatechange = function () {
if (req.readyState != 4)
return;
if (req.status == 200)
return callback && callback(req.responseText, req);
- else
- throw new Error(req.statusText)
+ else
+ throw new Error(req.statusText);
};
- req.open("GET", 'http://bit.ly/api?url=' + uri, callback);
+ req.open('GET', 'http://bit.ly/api?url=' + uri, callback);
req.send(null);
return !callback && req.responseText;
}
@@ -37,12 +37,10 @@
});
}
);
-
+
// 外から使えるように
liberator.plugins.bitly = {
- get: bitly,
+ get: bitly
};
})();
-
-
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();