This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# Language JavaScriptFFI #-} | |
{-# Language OverloadedStrings #-} | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
describeString :: Text -> String | |
describeString n = mconcat | |
[ T.unpack n | |
, " (" | |
, show n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# language PackageImports #-} | |
import Control.Monad | |
import "ghcjs-dom" GHCJS.DOM.Document (getBody) | |
import GHCJS.DOM.EventM (on, preventDefault) | |
import GHCJS.DOM.GlobalEventHandlers (keyDown) | |
import Reflex.Dom hiding (preventDefault) | |
import Web.KeyCode | |
main :: IO () | |
main = mainWidget $ do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Control.Monad.IO.Class | |
import GHCJS.DOM (webViewGetDomDocument) | |
import GHCJS.DOM.Document (getBody) | |
import GHCJS.DOM.Element (keyDown) | |
import GHCJS.DOM.EventM (on, preventDefault) | |
import Reflex.Dom | |
main :: IO () | |
main = mainWidget $ do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- Add leaflet css --> | |
<link | |
rel="stylesheet" href="https://unpkg.com/leaflet@1.5.1/dist/leaflet.css" | |
integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" | |
crossorigin="" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE RecursiveDo #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Data.Map as Map | |
import qualified Data.Text as T | |
import Reflex.Dom | |
import GHCJS.DOM.Element (setScrollTop, getScrollHeight) | |
main :: IO () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Control.Lens ((&), (%~), (.~)) | |
import Data.Proxy | |
import Reflex.Dom | |
main :: IO () | |
main = mainWidget $ do | |
(click, ()) <- linkPreventDefault $ text "O.S." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TypeApplications #-} | |
module Frontend where | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Obelisk.Frontend | |
import Obelisk.Route | |
import Reflex.Dom.Core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeFamilies, RecursiveDo, OverloadedStrings #-} | |
import qualified Data.Map as Map | |
import Data.Monoid | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
import Reflex.Dom | |
main :: IO () | |
main = mainWidgetWithHead headWidget bodyWidget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE ScopedTypeVariables, RankNTypes #-} | |
import Reflex.Dom | |
import Data.Monoid ((<>)) | |
import Data.List (isPrefixOf) | |
main :: IO () | |
main = mainWidgetWithHead headTag bodyTag | |
headTag :: MonadWidget t m => m () | |
headTag = elAttr "link" ("rel" =: "stylesheet" <> "href" =: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css") $ return () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Reflex.Dom | |
import Data.Monoid | |
main :: IO () | |
main = mainWidgetWithHead headWidget bodyWidget | |
headWidget = do | |
elAttr "link" ("href" =: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" <> "rel" =: "stylesheet" <> "type" =: "text/css") $ return () | |
bodyWidget = do |
NewerOlder