module JSDOM.Generated.Location
(assign, replace, reload, setHref, getHref, setProtocol,
getProtocol, setHost, getHost, setHostname, getHostname, setPort,
getPort, setPathname, getPathname, setSearch, getSearch, setHash,
getHash, getOrigin, getAncestorOrigins, Location(..),
gTypeLocation)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
assign :: (MonadDOM m, ToJSString url) => Location -> url -> m ()
assign self url
= liftDOM (void (self ^. jsf "assign" [toJSVal url]))
replace :: (MonadDOM m, ToJSString url) => Location -> url -> m ()
replace self url
= liftDOM (void (self ^. jsf "replace" [toJSVal url]))
reload :: (MonadDOM m) => Location -> m ()
reload self = liftDOM (void (self ^. jsf "reload" ()))
setHref :: (MonadDOM m, ToJSString val) => Location -> val -> m ()
setHref self val = liftDOM (self ^. jss "href" (toJSVal val))
getHref ::
(MonadDOM m, FromJSString result) => Location -> m result
getHref self = liftDOM ((self ^. js "href") >>= fromJSValUnchecked)
setProtocol ::
(MonadDOM m, ToJSString val) => Location -> val -> m ()
setProtocol self val
= liftDOM (self ^. jss "protocol" (toJSVal val))
getProtocol ::
(MonadDOM m, FromJSString result) => Location -> m result
getProtocol self
= liftDOM ((self ^. js "protocol") >>= fromJSValUnchecked)
setHost :: (MonadDOM m, ToJSString val) => Location -> val -> m ()
setHost self val = liftDOM (self ^. jss "host" (toJSVal val))
getHost ::
(MonadDOM m, FromJSString result) => Location -> m result
getHost self = liftDOM ((self ^. js "host") >>= fromJSValUnchecked)
setHostname ::
(MonadDOM m, ToJSString val) => Location -> val -> m ()
setHostname self val
= liftDOM (self ^. jss "hostname" (toJSVal val))
getHostname ::
(MonadDOM m, FromJSString result) => Location -> m result
getHostname self
= liftDOM ((self ^. js "hostname") >>= fromJSValUnchecked)
setPort :: (MonadDOM m, ToJSString val) => Location -> val -> m ()
setPort self val = liftDOM (self ^. jss "port" (toJSVal val))
getPort ::
(MonadDOM m, FromJSString result) => Location -> m result
getPort self = liftDOM ((self ^. js "port") >>= fromJSValUnchecked)
setPathname ::
(MonadDOM m, ToJSString val) => Location -> val -> m ()
setPathname self val
= liftDOM (self ^. jss "pathname" (toJSVal val))
getPathname ::
(MonadDOM m, FromJSString result) => Location -> m result
getPathname self
= liftDOM ((self ^. js "pathname") >>= fromJSValUnchecked)
setSearch ::
(MonadDOM m, ToJSString val) => Location -> val -> m ()
setSearch self val = liftDOM (self ^. jss "search" (toJSVal val))
getSearch ::
(MonadDOM m, FromJSString result) => Location -> m result
getSearch self
= liftDOM ((self ^. js "search") >>= fromJSValUnchecked)
setHash :: (MonadDOM m, ToJSString val) => Location -> val -> m ()
setHash self val = liftDOM (self ^. jss "hash" (toJSVal val))
getHash ::
(MonadDOM m, FromJSString result) => Location -> m result
getHash self = liftDOM ((self ^. js "hash") >>= fromJSValUnchecked)
getOrigin ::
(MonadDOM m, FromJSString result) => Location -> m result
getOrigin self
= liftDOM ((self ^. js "origin") >>= fromJSValUnchecked)
getAncestorOrigins :: (MonadDOM m) => Location -> m DOMStringList
getAncestorOrigins self
= liftDOM ((self ^. js "ancestorOrigins") >>= fromJSValUnchecked)