julius $ -> %

This commit is contained in:
Michael Snoyman 2010-08-25 09:13:57 +03:00
parent f102b9882b
commit b0c2bf0a3b
3 changed files with 12 additions and 12 deletions

View File

@ -57,7 +57,7 @@ jqueryDayFieldProfile = FieldProfile
addScript' urlJqueryUiJs addScript' urlJqueryUiJs
addStylesheet' urlJqueryUiCss addStylesheet' urlJqueryUiCss
addJavascript [$julius| addJavascript [$julius|
$$(function(){$$("#$theId$").datepicker({dateFormat:'yy-mm-dd'})}); $(function(){$("#%theId%").datepicker({dateFormat:'yy-mm-dd'})});
|] |]
} }
@ -95,7 +95,7 @@ jqueryDayTimeFieldProfile = FieldProfile
addScript' urlJqueryUiDateTimePicker addScript' urlJqueryUiDateTimePicker
addStylesheet' urlJqueryUiCss addStylesheet' urlJqueryUiCss
addJavascript [$julius| addJavascript [$julius|
$$(function(){$$("#$theId$").datetimepicker({dateFormat : "yyyy/mm/dd h:MM TT"})}); $(function(){$("#%theId%").datetimepicker({dateFormat : "yyyy/mm/dd h:MM TT"})});
|] |]
} }
@ -130,7 +130,7 @@ jqueryAutocompleteFieldProfile src = FieldProfile
addScript' urlJqueryUiJs addScript' urlJqueryUiJs
addStylesheet' urlJqueryUiCss addStylesheet' urlJqueryUiCss
addJavascript [$julius| addJavascript [$julius|
$$(function(){$$("#$theId$").autocomplete({source:"@src@",minLength:2})}); $(function(){$("#%theId%").autocomplete({source:"@src@",minLength:2})});
|] |]
} }

View File

@ -29,7 +29,7 @@ nicHtmlFieldProfile = FieldProfile
, fpWidget = \theId name val _isReq -> do , fpWidget = \theId name val _isReq -> do
addBody [$hamlet|%textarea.html#$theId$!name=$name$ $val$|] addBody [$hamlet|%textarea.html#$theId$!name=$name$ $val$|]
addScript' urlNicEdit addScript' urlNicEdit
addJavascript [$julius|bkLib.onDomLoaded(function(){new nicEditor({fullPanel:true}).panelInstance("$theId$")});|] addJavascript [$julius|bkLib.onDomLoaded(function(){new nicEditor({fullPanel:true}).panelInstance("%theId%")});|]
} }
addScript' :: (y -> Either (Route y) String) -> GWidget sub y () addScript' :: (y -> Either (Route y) String) -> GWidget sub y ()

View File

@ -33,12 +33,12 @@ wrapper h = [$hamlet|
#wrapper ^h^ #wrapper ^h^
%footer Brought to you by Yesod Widgets™ %footer Brought to you by Yesod Widgets™
|] |]
getRootR = applyLayoutW $ flip wrapWidget wrapper $ do getRootR = defaultLayout $ flip wrapWidget wrapper $ do
i <- newIdent i <- newIdent
setTitle $ string "Hello Widgets" setTitle $ string "Hello Widgets"
addStyle [$cassius| addStyle [$cassius|
#$i$ #$i$
color:red color: red
|] |]
addStylesheet $ StaticR $ StaticRoute ["style.css"] [] addStylesheet $ StaticR $ StaticRoute ["style.css"] []
addStylesheetRemote "http://localhost:3000/static/style2.css" addStylesheetRemote "http://localhost:3000/static/style2.css"
@ -82,16 +82,16 @@ handleFormR = do
let txt = case res of let txt = case res of
FormSuccess (_, _, _, _, _, _, _, _, _, _, Just x) -> Just x FormSuccess (_, _, _, _, _, _, _, _, _, _, Just x) -> Just x
_ -> Nothing _ -> Nothing
applyLayoutW $ do defaultLayout $ do
addStyle [$cassius| addStyle [$cassius|
.tooltip .tooltip
color:#666 color: #666
font-style:italic font-style: italic
|] |]
addStyle [$cassius| addStyle [$cassius|
textarea.html textarea.html
width:300px width: 300px
height:150px height: 150px
|] |]
wrapWidget form $ \h -> [$hamlet| wrapWidget form $ \h -> [$hamlet|
%form!method=post!enctype=$enctype$ %form!method=post!enctype=$enctype$
@ -134,7 +134,7 @@ getCustomFormR = do
|] |]
return (Person <$> a1 <*> a2, b , c1 `mappend` c2) return (Person <$> a1 <*> a2, b , c1 `mappend` c2)
(_, wform, enctype) <- runFormGet customForm (_, wform, enctype) <- runFormGet customForm
applyLayoutW $ do defaultLayout $ do
form <- extractBody wform form <- extractBody wform
addBody [$hamlet| addBody [$hamlet|
%form %form