blob: aaf3747d63736c8e9cabe05b415c5af14ec58bdb (
plain)
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
|
module JavaScript (
module JavaScript.Event,
module JavaScript.Element,
module JavaScript.Window,
toJSVal,
consoleLog,
consoleLogVal,
historyPushState,
) where
import JavaScript.Element
import JavaScript.Event
import JavaScript.Val
import JavaScript.Window
consoleLog :: String -> IO ()
consoleLog = js_consoleLog . toJSString
foreign import javascript unsafe "console.log($1)"
js_consoleLog :: JSString -> IO ()
foreign import javascript unsafe "console.log($1)"
consoleLogVal :: JSVal -> IO ()
historyPushState :: String -> IO ()
historyPushState = js_history_pushState . toJSString
foreign import javascript unsafe "history.pushState(null, '', $1)"
js_history_pushState :: JSString -> IO ()
|