forked from idris-hackers/iQuery
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIQuery.idr
More file actions
81 lines (61 loc) · 1.93 KB
/
IQuery.idr
File metadata and controls
81 lines (61 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
module IQuery
import IQuery.Timeout
import IQuery.Interval
import IQuery.Event
import IQuery.Elements
import IQuery.Utils
%access public
-- Window Object functions
alert : String -> IO ()
alert msg =
mkForeign (FFun "alert(%0)" [FString] FUnit) msg
atob : String -> IO String
atob str =
mkForeign (FFun "atob(%0)" [FString] FString) str
blur : IO ()
blur = mkForeign (FFun "blur()" [] FUnit)
btoa : String -> IO String
btoa str =
mkForeign (FFun "btoa(%0)" [FString] FString) str
close : IO ()
close = mkForeign (FFun "close()" [] FUnit)
confirm : Maybe String -> IO Bool
confirm (Just msg) = map intToBool $
mkForeign (FFun "confirm(%0)" [FString] FInt) msg
confirm Nothing = map intToBool $
mkForeign (FFun "confirm()" [] FInt)
focus : IO ()
focus = mkForeign (FFun "focus()" [] FUnit)
moveBy : Int -> Int -> IO ()
moveBy x y =
mkForeign (FFun "moveBy(%0,%1)" [FInt, FInt] FUnit) x y
moveTo : Int -> Int -> IO ()
moveTo x y =
mkForeign (FFun "moveTo(%0,%1)" [FInt, FInt] FUnit) x y
open : String -> String -> String -> Bool -> IO ()
open url name specs replace =
mkForeign (FFun "open(%0,%1,%2,%3)"
[FString, FString, FString, FInt]
FUnit
) url name specs (boolToInt replace)
print : IO ()
print = mkForeign (FFun "print()" [] FUnit)
prompt : String -> String -> IO (Maybe String)
prompt msg default =
mkForeign (
FFun "prompt(%0,%1)" [FString, FString] FString
) msg default >>= nullCheck {t = FString}
resizeBy : Int -> Int -> IO ()
resizeBy x y =
mkForeign (FFun "resizeBy(%0,%1)" [FInt, FInt] FUnit) x y
resizeTo : Int -> Int -> IO ()
resizeTo x y =
mkForeign (FFun "resizeTo(%0,%1)" [FInt, FInt] FUnit) x y
scrollBy : Int -> Int -> IO ()
scrollBy x y =
mkForeign (FFun "scrollBy(%0,%1)" [FInt, FInt] FUnit) x y
scrollTo : Int -> Int -> IO ()
scrollTo x y =
mkForeign (FFun "scrollTo(%0,%1)" [FInt, FInt] FUnit) x y
stop : IO ()
stop = mkForeign (FFun "stop()" [] FUnit)