kiss-spaced-rep refresh flow
This commit is contained in:
@@ -27,4 +27,6 @@
|
||||
(cc))
|
||||
|
||||
(method :Void getUserInput [resolve]
|
||||
(resolve (.readLine (Sys.stdin))))
|
||||
(resolve (.readLine (Sys.stdin))))
|
||||
|
||||
(method :Void promptForRefresh [:Void->Void refresh] null)
|
@@ -169,6 +169,7 @@
|
||||
{
|
||||
(engine.clear)
|
||||
(engine.println "All cards studied")
|
||||
(engine.promptForRefresh ->(studyAll engine))
|
||||
}))
|
||||
|
||||
(defReaderMacro ["*" "?"] [stream &builder b]
|
||||
|
@@ -7,6 +7,7 @@ interface StudyEngine {
|
||||
function print(s:String):Void;
|
||||
function println(s:String):Void;
|
||||
function showImage(s:String):Void;
|
||||
function delayForUserInput(cc:Continuation):Void;
|
||||
function delayForUserInput(cc:Continuation, ?text:String):Void;
|
||||
function getUserInput(resolve:String->Void):Void;
|
||||
function promptForRefresh(refresh:Void->Void):Void;
|
||||
}
|
||||
|
@@ -43,11 +43,15 @@
|
||||
(method :Void showImage [path]
|
||||
(+= content "<img src=\"/static/${path}\" /><br />"))
|
||||
|
||||
(method :Void delayForUserInput [cc]
|
||||
(method :Void delayForUserInput [cc &opt :String text]
|
||||
(set this.cc cc)
|
||||
(+= content "<br /><a href=\"/continue\">Next</a><br />"))
|
||||
(unless text
|
||||
(set text "Next"))
|
||||
(+= content "<br /><a href=\"/continue\">${text}</a><br />"))
|
||||
|
||||
(method :Void getUserInput [resolve]
|
||||
(set this.resolve resolve)
|
||||
(+= content "<br /><input type=\"text\" id=\"value\"><br /><button onclick=\"window.open('/submit?value=' + document.getElementById('value').value, '_self');\">Submit</a><br />"))
|
||||
|
||||
(method :Void promptForRefresh [refresh]
|
||||
(delayForUserInput refresh "Refresh"))
|
||||
|
Reference in New Issue
Block a user