This repository was archived by the owner on Oct 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -107,9 +107,11 @@ exports.print = function (window) {
107107} ;
108108
109109exports . _prompt = function ( str ) {
110- return function ( window ) {
111- return function ( ) {
112- return window . prompt ( str ) ;
110+ return function ( defaultText ) {
111+ return function ( window ) {
112+ return function ( ) {
113+ return window . prompt ( str , defaultText ) ;
114+ } ;
113115 } ;
114116 } ;
115117} ;
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ module DOM.HTML.Window
1414 , outerWidth
1515 , print
1616 , prompt
17+ , promptDefault
1718 , resizeBy
1819 , resizeTo
1920 , screenX
@@ -72,9 +73,12 @@ foreign import outerWidth :: forall eff. Window -> Eff (dom :: DOM | eff) Int
7273foreign import print :: forall eff . Window -> Eff (window :: WINDOW | eff ) Unit
7374
7475prompt :: forall eff . String -> Window -> Eff (prompt :: PROMPT | eff ) (Maybe String )
75- prompt window msg = toMaybe <$> _prompt window msg
76+ prompt msg window = toMaybe <$> _prompt msg " " window
7677
77- foreign import _prompt :: forall eff . String -> Window -> Eff (prompt :: PROMPT | eff ) (Nullable String )
78+ promptDefault :: forall eff . String -> String -> Window -> Eff (prompt :: PROMPT | eff ) (Maybe String )
79+ promptDefault msg defaultText window = toMaybe <$> _prompt msg defaultText window
80+
81+ foreign import _prompt :: forall eff . String -> String -> Window -> Eff (prompt :: PROMPT | eff ) (Nullable String )
7882
7983foreign import resizeBy :: forall eff . Int -> Int -> Window -> Eff (window :: WINDOW | eff ) Unit
8084
You can’t perform that action at this time.
0 commit comments