diff options
author | anekos | 2010-07-31 13:17:12 +0000 |
---|---|---|
committer | anekos | 2010-07-31 13:17:12 +0000 |
commit | 736b3d9a3b13d44e9bc358fabe32801849d13dff (patch) | |
tree | 731926425c2c4a0e39721f950ef41959f65b5a0e | |
parent | f340e7d71a978c3d2c6fbacd577fcfa1c4f2c9c2 (diff) | |
download | vimperator-plugins-736b3d9a3b13d44e9bc358fabe32801849d13dff.tar.bz2 |
プラグインローダ追加
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38100 d0d07461-0603-4401-acd4-de1884942a52
-rwxr-xr-x | twittperator.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/twittperator.js b/twittperator.js index 1516912..31b494c 100755 --- a/twittperator.js +++ b/twittperator.js @@ -1347,6 +1347,22 @@ liberator.echo("[Twittperator] ReTweet: " + res.retweeted_status.text, true); }); } // }}} +function sourceScriptFile(file) { // {{{ + // XXX 悪い子向けのハックです。すみません。 *.tw ファイルを *.js のように読み込みます。 + file = file.clone; + let toString = file.toString; + file.toString = function () this.path.replace(/\.tw$/, ".js"); + io.source(file, false); + file.toString = toString; +} // }}} +function loadPlugins() { // {{{ + io.getRuntimeDirectories("plugin/twittperator").forEach(function(dir) { + dir.readDirectory().forEach(function(file) { + if (/\.tw$/(file.path)) + sourceScriptFile(file); + }); + }); +} // }}} function setup() { // {{{ function commandCompelter(context, args) { function statusObjectFilter(item) @@ -1514,7 +1530,9 @@ } let tw = new TwitterOauth(accessor); + __context__.OAuth = tw; + __context__.ChirpUserStream = ChirpUserStream; // }}} })(); |