From 22de3820aeb3b7d5d1fce281bc31d08731a89dba Mon Sep 17 00:00:00 2001 From: Gabor Bata Date: Fri, 5 Mar 2021 16:25:52 +0100 Subject: [PATCH] Increase app version --- todo.gemspec | 2 +- web/app.js | 4 ++-- web/app.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/todo.gemspec b/todo.gemspec index f75616d..3e0252a 100644 --- a/todo.gemspec +++ b/todo.gemspec @@ -1,6 +1,6 @@ Gem::Specification.new do |s| s.name = 'todo-jsonl' - s.version = '0.1.22' + s.version = '0.1.23' s.date = '2021-03-05' s.summary = 'todo list manager inspired by todo.txt using the jsonl format' s.authors = ['Gabor Bata'] diff --git a/web/app.js b/web/app.js index 8eaa676..1990461 100644 --- a/web/app.js +++ b/web/app.js @@ -748,10 +748,10 @@ e);null==xa&&(xa=e);null==Ha&&(Ha=e);Qa=d(Oa=Ha["$[]"]("state"))?Oa:"default";kb Ca)&&(Qa=r(E(h,"Date").$parse(Ha["$[]"]("due")),Ea.today).$to_i(),d(p(Qa,0))?ya=Ea.$colorize("("+Qa.$abs()+"d overdue)","red"):d(d(Va=Qa["$=="](0))?Va:Qa["$=="](1))?ya=Ea.$colorize("("+E(h,"DUE_DATE_DAYS_SIMPLE")["$[]"](Qa)+")","yellow"):d(G(Qa,1))&&(ya=Ea.$colorize("("+(d(hb=Ea.due_date_days["$[]"](Qa))?hb:Ha["$[]"]("due"))+")","magenta")),ya=v(" ",ya));return Ea.text_buffer.$push(""+xa.$to_s().$rjust(ta," ")+":"+W+kb+" "+lb+ya)},S.$$s=this,S.$$arity=2,S));return d(ma["$empty?"]())?this.text_buffer.$push("No todos found"): e},va.$$arity=-1);a.def(m,"$add_note",Na=function(ba,ka){var Y;var S=this.$load_tasks(ba);var V=S["$[]"](ba);d(Y=V["$[]"]("note"))?Y:(Y=["note",[]],c(V,"[]=",a.to_a(Y)),Y[r(Y.length,1)]);S["$[]"](ba)["$[]"]("note").$push(ka);Y=["modified",this.today.$strftime(E(h,"DATE_FORMAT"))];c(S["$[]"](ba),"[]=",a.to_a(Y));Y[r(Y.length,1)];this.$write_tasks(S);return this.$show(ba)},Na.$$arity=2);a.def(m,"$delete_note",wa=function(ba){var ka=this.$load_tasks(ba);ka["$[]"](ba).$delete("note");var Y=["modified", this.today.$strftime(E(h,"DATE_FORMAT"))];c(ka["$[]"](ba),"[]=",a.to_a(Y));Y[r(Y.length,1)];this.$write_tasks(ka);return this.$show(ba)},wa.$$arity=1);a.def(m,"$show",Aa=function(ba){var ka,Y=e;Y=this.$load_tasks(ba);return c(Y["$[]"](ba),"each",[],(ka=function(S,V){var ta=null==ka.$$s?this:ka.$$s;null==ta.text_buffer&&(ta.text_buffer=e);null==S&&(S=e);null==V&&(V=e);V=d(V["$kind_of?"](E(h,"Array")))?v("\n",V.$join("\n")):V;return ta.text_buffer.$push(""+ta.$colorize(v(S.$to_s().$rjust(10," "),":"), -"cyan")+" "+V)},ka.$$s=this,ka.$$arity=2,ka))},Aa.$$arity=1);a.def(m,"$cleanup",Ka=function(ba){var ka,Y=e,S=e;Y=this.$load_tasks();ba=v([this.queries["$[]"](":done")],ba.$to_a());S=this.$filter_tasks(Y,ba);c(S.$keys(),"each",[],(ka=function(V){null==V&&(V=e);return Y.$delete(V)},ka.$$s=this,ka.$$arity=1,ka));this.$write_tasks(Y);return this.text_buffer.$push("deleted "+S.$size()+" todo(s)")},Ka.$$arity=1);a.def(m,"$filter_tasks",oa=function(ba,ka){var Y,S=e;S=g([],{});c(ba,"each",[],(Y=function(V, +"cyan")+" "+V)},ka.$$s=this,ka.$$arity=2,ka))},Aa.$$arity=1);a.def(m,"$cleanup",Ka=function(ba){var ka,Y=e,S=e;Y=this.$load_tasks();ba=v([this.queries["$[]"](":done")],ba.$to_a());S=this.$filter_tasks(Y,ba);c(S.$keys(),"each",[],(ka=function(V){null==V&&(V=e);return Y.$delete(V)},ka.$$s=this,ka.$$arity=1,ka));this.$write_tasks(Y);return this.text_buffer.$push("Deleted "+S.$size()+" todo(s)")},Ka.$$arity=1);a.def(m,"$filter_tasks",oa=function(ba,ka){var Y,S=e;S=g([],{});c(ba,"each",[],(Y=function(V, ta){var Da=null==Y.$$s?this:Y.$$s,ma,xa=e,Ha=e,Ea=e;null==V&&(V=e);null==ta&&(ta=e);xa="state="+ta["$[]"]("state")+" due="+ta["$[]"]("due")+" "+ta["$[]"]("title");Ha=!0;c(ka,"each",[],(ma=function(Sa){var Qa=null==ma.$$s?this:ma.$$s,Oa=e;null==Qa.queries&&(Qa.queries=e);null==Sa&&(Sa=e);return d(a.regexp([d(Oa=Qa.queries["$[]"](Sa))?Oa:Sa],"i").$match(xa))?e:Ha=!1},ma.$$s=Da,ma.$$arity=1,ma));return d(Ha)?(Ea=[V,ta],c(S,"[]=",a.to_a(Ea)),Ea[r(Ea.length,1)]):e},Y.$$s=this,Y.$$arity=2,Y));return S}, oa.$$arity=2);a.def(m,"$colorize",R=function(ba,ka){return"e["+E(h,"COLOR_CODES")["$[]"](ka)+"m"+ba+"e[0m"},R.$$arity=2);return(a.def(m,"$convert_due_date",sa=function(ba){var ka,Y=this,S=e,V=S=e,ta=e,Da=e;null==ba&&(ba="");S=e;S=function(){return d(V=d(ta=Y.due_date_days.$index(ba.$to_s().$downcase()))?ta:E(h,"DUE_DATE_DAYS_SIMPLE").$index(ba.$to_s().$downcase()))?V:c(Y.due_date_days,"map",[],(ka=function(ma){null==ma&&(ma=e);return ma["$[]"](y(0,2,!1))},ka.$$s=Y,ka.$$arity=1,ka)).$index(ba.$to_s().$downcase())}(); return S=d(S)?v(Y.today,S).$strftime(E(h,"DATE_FORMAT")):d(d(Da=ba["$nil?"]())?Da:ba["$empty?"]())?e:E(h,"Date").$parse(ba).$strftime(E(h,"DATE_FORMAT"))},sa.$$arity=-1),e)&&"convert_due_date"}(q[0],null,q)}; (function(a){function v(d){return(d||"").toString().replace(/&/g,"&").replace(//g,">")}var G,p=a.top,r=[],x=a.nil,q=a.$$$,e=a.$$,E=a.send,B=x,g=x;a.add_stubs("$require $new $lambda $to_html $execute $+".split(" "));p.$require("./todo.rb");B=e(r,"Todo").$new();g=E(p,"lambda",[],(G=function(d,y,c){null==d&&(d=x);null==y&&(y=x);null==c&&(c=x);try{var m=B,J=m.$execute;y=[y];var f="number"===typeof y&&"number"===typeof c?y+c:y["$+"](c);var h=J.call(m,f).$to_html();d.output(h)}catch(L){d.output('ERROR: '+ -v(L)+"")}},G.$$s=p,G.$$arity=3,G));a=new VanillaTerminal({welcome:'todo list manager REPL v0.1.22
Type "help" or "copyright" for more information.

',defaultCallback:g,prompt:"todo",commands:{cls:function(d){d.clear()},copyright:function(d){d.output('todo-jsonl - Copyright (c) 2020-2021 Gabor Bata
opal - Copyright (c) 2013-2021 by Adam Beynon and the Opal contributors
vanilla-terminal - Copyright (c) 2018 Javier Jimenez Villar
')},wipe:function(d){d.prompt("Are you sure remove all your todo data? y/n", +v(L)+"")}},G.$$s=p,G.$$arity=3,G));a=new VanillaTerminal({welcome:'todo list manager REPL v0.1.23
Type "help" or "copyright" for more information.

',defaultCallback:g,prompt:"todo",commands:{cls:function(d){d.clear()},copyright:function(d){d.output('todo-jsonl - Copyright (c) 2020-2021 Gabor Bata
opal - Copyright (c) 2013-2021 by Adam Beynon and the Opal contributors
vanilla-terminal - Copyright (c) 2018 Javier Jimenez Villar
')},wipe:function(d){d.prompt("Are you sure remove all your todo data? y/n", function(y){"Y"===y.trim().toUpperCase()&&(localStorage.removeItem(q(e(r,"Todo"),"TODO_FILE")),d.history=[],d.historyCursor=0,d.output("todo data wiped"))})}}});try{a.output(B.$execute(["list"]).$to_html())}catch(d){a.output('ERROR: '+v(d)+"")}})(Opal);var Qb=Opal.$$;Opal.add_stubs(["$exit"]);Qb([],"Kernel").$exit();}).call(this); diff --git a/web/app.rb b/web/app.rb index efe0ba0..01d5531 100644 --- a/web/app.rb +++ b/web/app.rb @@ -19,7 +19,7 @@ }; var term = new VanillaTerminal({ - 'welcome': 'todo list manager REPL v0.1.22
Type "help" or "copyright" for more information.

', + 'welcome': 'todo list manager REPL v0.1.23
Type "help" or "copyright" for more information.

', 'defaultCallback': default_callback, 'prompt': 'todo', 'commands': {