aboutsummaryrefslogtreecommitdiffstats
path: root/usi.js
diff options
context:
space:
mode:
authoranekos2011-02-26 01:25:46 +0900
committeranekos2011-02-26 01:25:46 +0900
commitf94a80cacda156307163af1ea30b9ade5c6f5543 (patch)
tree7b1f9542d63a6edc579663277acef7c9b628f19a /usi.js
parente552a90210197f43a6546910ab71f828a8b1b0d5 (diff)
downloadvimperator-plugins-f94a80cacda156307163af1ea30b9ade5c6f5543.tar.bz2
:usi task<CR> でタスクの表示をするようにした
Diffstat (limited to 'usi.js')
-rw-r--r--usi.js33
1 files changed, 31 insertions, 2 deletions
diff --git a/usi.js b/usi.js
index 5e1021d..c14ac8a 100644
--- a/usi.js
+++ b/usi.js
@@ -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