{-# LANGUAGE FlexibleContexts, ScopedTypeVariables #-}
module Graphics.UI.Threepenny.Core (
-- * Synopsis
-- | Core functionality of the Threepenny GUI library.
-- * Server
-- $server
Config(..), defaultConfig, startGUI,
loadFile, loadDirectory,
-- * UI monad
-- $ui
UI, runUI, MonadUI(..), askWindow, liftIOLater,
module Control.Monad.IO.Class,
module Control.Monad.Fix,
-- * Browser Window
Window, title,
-- * DOM elements
-- | Create and manipulate DOM elements.
Element, getWindow, mkElement, mkElementNamespace, delete,
string,
getHead, getBody,
(#+), children, text, html, attr, style, value,
getElementsByTagName, getElementById, getElementsByClassName,
-- * Layout
-- | Combinators for quickly creating layouts.
-- They can be adjusted with CSS later on.
grid, row, column,
-- * Events
-- | For a list of predefined events, see "Graphics.UI.Threepenny.Events".
EventData, domEvent, unsafeFromJSON, disconnect, on, onEvent, onChanges,
module Reactive.Threepenny,
-- * Attributes
-- | For a list of predefined attributes, see "Graphics.UI.Threepenny.Attributes".
(#), (#.),
Attr, WriteAttr, ReadAttr, ReadWriteAttr(..),
set, sink, get, mkReadWriteAttr, mkWriteAttr, mkReadAttr,
bimapAttr, fromObjectProperty,
-- * Widgets
Widget(..), element, widget,
-- * JavaScript FFI
-- | Direct interface to JavaScript in the browser window.
debug, timestamp,
ToJS, FFI,
JSFunction, ffi, runFunction, callFunction,
CallBufferMode(..), setCallBufferMode, flushCallBuffer,
ffiExport,
-- ** Internals
toJSObject, liftJSWindow,
-- * Internal and oddball functions
fromJQueryProp,
) where
import Control.Monad (forM_, forM, void)
import Control.Monad.Fix
import Control.Monad.IO.Class
import qualified Control.Monad.Catch as E
import qualified Data.Aeson as JSON
import qualified Foreign.JavaScript as JS
import qualified Graphics.UI.Threepenny.Internal as Core
import qualified Reactive.Threepenny as Reactive
-- exports
import Foreign.JavaScript (Config(..), defaultConfig)
import Graphics.UI.Threepenny.Internal
import Reactive.Threepenny hiding (onChange)
{-----------------------------------------------------------------------------
Server
------------------------------------------------------------------------------}
{- $server
To display the user interface, you have to start a server using 'startGUI'.
Then, visit the URL