diff options
author | anekos | 2011-02-26 01:25:46 +0900 |
---|---|---|
committer | anekos | 2011-02-26 01:25:46 +0900 |
commit | f94a80cacda156307163af1ea30b9ade5c6f5543 (patch) | |
tree | 7b1f9542d63a6edc579663277acef7c9b628f19a /usi.js | |
parent | e552a90210197f43a6546910ab71f828a8b1b0d5 (diff) | |
download | vimperator-plugins-f94a80cacda156307163af1ea30b9ade5c6f5543.tar.bz2 |
:usi task<CR> でタスクの表示をするようにした
Diffstat (limited to 'usi.js')
-rw-r--r-- | usi.js | 33 |
1 files changed, 31 insertions, 2 deletions
@@ -35,7 +35,7 @@ THE POSSIBILITY OF SUCH DAMAGE. // INFO {{{ let INFO = <> - <plugin name="usi.js" version="1.0.0" + <plugin name="usi.js" version="1.1.0" href="http://vimpr.github.com/" summary="for Remember The Milk." lang="en-US" @@ -667,7 +667,36 @@ let INFO = ['t[ask]'], 'Task control', function (args) { - + Cow.get( + { + method: 'rtm.tasks.getList', + filter: 'status:incomplete' + }, + { + cache: 'rtm.tasks.getList?filter=status:incomplete', + onComplete: function (result) { + let cs = []; + + for (let [, list] in Iterator(result.tasks.list)) { + for (let [, taskseries] in Iterator(list.taskseries)) { + for (let [, task] in Iterator(taskseries.task)) { + cs.push([ + let (d = Utils.toDate(task.@due)) + (d ? d.getTime() : Infinity), + [taskseries.@name, Utils.toSmartDateText(task.@due)] + ]); + } + } + } + let n = new Date().getTime(); + cs.sort(function ([a], [b]) Math.abs(a - n) - Math.abs(b - n)); + let contents = <></>; + for (let [, [, [a, b]]] in Iterator(cs)) + contents += <tr><td>{a}</td><td>{b}</td></tr>; + liberator.echo(<><table>{contents}</table></>); + } + } + ); }, { subCommands: TaskSubCommands |