{-# LANGUAGE DeriveDataTypeable, RecordWildCards #-}
{-# LANGUAGE RecursiveDo #-}
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, askWindow, liftIOLater,
module Control.Monad.IO.Class,
module Control.Monad.Fix,
-- * Browser Window
Window, title, cookies, getRequestLocation,
-- * DOM elements
-- | Create and manipulate DOM elements.
Element, mkElement, getWindow, delete, (#+), string,
getHead, getBody,
children, text, html, attr, style, value,
getValuesList,
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, 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,
-- * Widgets
Widget(..), element, widget,
-- * JavaScript FFI
-- | Direct interface to JavaScript in the browser window.
debug,
ToJS, FFI, ffi, JSFunction, runFunction, callFunction,
callDeferredFunction, atomic,
-- * Internal and oddball functions
fromProp, toElement,
audioPlay, audioStop,
) where
import Data.Dynamic
import Data.IORef
import qualified Data.Map as Map
import Data.Maybe (listToMaybe)
import Data.Functor
import Data.String (fromString)
import Control.Concurrent.MVar
import Control.Monad
import Control.Monad.Fix
import Control.Monad.IO.Class
import qualified Control.Monad.Trans.RWS.Lazy as Monad
import Network.URI
import qualified Data.Aeson as JSON
import Reactive.Threepenny hiding (onChange)
import qualified Reactive.Threepenny as Reactive
import qualified Graphics.UI.Threepenny.Internal.Driver as Core
import Graphics.UI.Threepenny.Internal.Driver
( getRequestLocation
, callDeferredFunction, atomic, )
import Graphics.UI.Threepenny.Internal.FFI
import Graphics.UI.Threepenny.Internal.Types as Core
( Window, Config, defaultConfig, Events, EventData
, ElementData(..), withElementData,)
import Graphics.UI.Threepenny.Internal.Types as Core
(unprotectedGetElementId, withElementData, ElementData(..))
{-----------------------------------------------------------------------------
Server
------------------------------------------------------------------------------}
{- $server
To display the user interface, you have to start a server using 'startGUI'.
Then, visit the URL