googleHostedJqueryUiCss
This commit is contained in:
parent
fd53c60fc9
commit
fde19d6291
@ -8,6 +8,7 @@ module Yesod.Form.Jquery
|
|||||||
, jqueryAutocompleteField
|
, jqueryAutocompleteField
|
||||||
, maybeJqueryAutocompleteField
|
, maybeJqueryAutocompleteField
|
||||||
, jqueryDayFieldProfile
|
, jqueryDayFieldProfile
|
||||||
|
, googleHostedJqueryUiCss
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Yesod.Handler
|
import Yesod.Handler
|
||||||
@ -19,18 +20,26 @@ import Data.Time (UTCTime (..), Day, TimeOfDay (..), timeOfDayToTime,
|
|||||||
import Yesod.Hamlet
|
import Yesod.Hamlet
|
||||||
import Data.Char (isSpace)
|
import Data.Char (isSpace)
|
||||||
|
|
||||||
|
-- | Gets the Google hosted jQuery UI 1.8 CSS file with the given theme.
|
||||||
|
googleHostedJqueryUiCss :: String -> String
|
||||||
|
googleHostedJqueryUiCss theme = concat
|
||||||
|
[ "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/"
|
||||||
|
, theme
|
||||||
|
, "/jquery-ui.css"
|
||||||
|
]
|
||||||
|
|
||||||
class YesodJquery a where
|
class YesodJquery a where
|
||||||
-- | The jQuery Javascript file.
|
-- | The jQuery 1.4 Javascript file.
|
||||||
urlJqueryJs :: a -> Either (Route a) String
|
urlJqueryJs :: a -> Either (Route a) String
|
||||||
urlJqueryJs _ = Right "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
|
urlJqueryJs _ = Right "http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"
|
||||||
|
|
||||||
-- | The jQuery UI 1.8.1 Javascript file.
|
-- | The jQuery UI 1.8 Javascript file.
|
||||||
urlJqueryUiJs :: a -> Either (Route a) String
|
urlJqueryUiJs :: a -> Either (Route a) String
|
||||||
urlJqueryUiJs _ = Right "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js"
|
urlJqueryUiJs _ = Right "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"
|
||||||
|
|
||||||
-- | The jQuery UI 1.8.1 CSS file; defaults to cupertino theme.
|
-- | The jQuery UI 1.8 CSS file; defaults to cupertino theme.
|
||||||
urlJqueryUiCss :: a -> Either (Route a) String
|
urlJqueryUiCss :: a -> Either (Route a) String
|
||||||
urlJqueryUiCss _ = Right "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/themes/cupertino/jquery-ui.css"
|
urlJqueryUiCss _ = Right $ googleHostedJqueryUiCss "cupertino"
|
||||||
|
|
||||||
-- | jQuery UI time picker add-on.
|
-- | jQuery UI time picker add-on.
|
||||||
urlJqueryUiDateTimePicker :: a -> Either (Route a) String
|
urlJqueryUiDateTimePicker :: a -> Either (Route a) String
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user