daml/bazel_tools/haskell-js-flot.patch

50 lines
1.5 KiB
Diff
Raw Normal View History

diff --git a/Language/Javascript/Flot.hs b/Language/Javascript/Flot.hs
index aefee8b..cd73443 100644
--- a/Language/Javascript/Flot.hs
+++ b/Language/Javascript/Flot.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE TemplateHaskell #-}
-- | Module for accessing minified flot code (<http://www.flotcharts.org/>).
-- As an example:
@@ -9,13 +10,14 @@
-- > putStrLn $ "Flot version " ++ show Flot.version ++ " source:"
-- > putStrLn =<< readFile =<< Flot.file Flot.Flot
module Language.Javascript.Flot(
- Flot(..), version, file
+ Flot(..), version, file, flotFileContent, flotStackFileContent
) where
import qualified Paths_js_flot as Paths
import Data.Version
import Data.Data
import Data.Char
+import Data.FileEmbed
-- | The Flot code to obtain. Use 'Flot' for the base system and the other values
@@ -42,6 +44,8 @@ data Flot
file :: Flot -> IO FilePath
file = Paths.getDataFileName . name
+flotFileContent = $(embedFile "javascript/jquery.flot.min.js")
+flotStackFileContent = $(embedFile "javascript/jquery.flot.stack.min.js")
name Flot = "jquery.flot.min.js"
name x = "jquery.flot." ++ map toLower (drop 4 $ show x) ++ ".min.js"
diff --git a/js-flot.cabal b/js-flot.cabal
index 2dabdb0..4b927df 100644
--- a/js-flot.cabal
+++ b/js-flot.cabal
@@ -48,7 +48,8 @@ source-repository head
library
default-language: Haskell2010
build-depends:
- base == 4.*
+ base == 4.*,
+ file-embed
exposed-modules:
Language.Javascript.Flot