From 2e4adb55512484eb880f908fca088786031bdf0d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 13 Aug 2010 17:29:13 +0300 Subject: [PATCH] jQuery and Nic fixes --- Yesod/Form/Jquery.hs | 10 +++++----- Yesod/Form/Nic.hs | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Yesod/Form/Jquery.hs b/Yesod/Form/Jquery.hs index 8f466ebc..85d26636 100644 --- a/Yesod/Form/Jquery.hs +++ b/Yesod/Form/Jquery.hs @@ -34,7 +34,7 @@ class YesodJquery a where -- | jQuery UI time picker add-on. urlJqueryUiDateTimePicker :: a -> Either (Route a) String - urlJqueryUiDateTimePicker _ = Right "http://www.projectcodegen.com/jquery.ui.datetimepicker.js.txt" + urlJqueryUiDateTimePicker _ = Right "http://github.com/gregwebs/jquery.ui.datetimepicker/raw/master/jquery.ui.datetimepicker.js" jqueryDayField :: YesodJquery y => FormFieldSettings -> FormletField sub y Day jqueryDayField = requiredFieldHelper jqueryDayFieldProfile @@ -57,7 +57,7 @@ jqueryDayFieldProfile = FieldProfile addScript' urlJqueryUiJs addStylesheet' urlJqueryUiCss addJavaScript [$julius| -$$(function(){$$("#$name$").datepicker({dateFormat:'yy-mm-dd'})}); +$$(function(){$$("#$theId$").datepicker({dateFormat:'yy-mm-dd'})}); |] } @@ -88,14 +88,14 @@ jqueryDayTimeFieldProfile = FieldProfile , fpRender = jqueryDayTimeUTCTime , fpWidget = \theId name val isReq -> do addBody [$hamlet| -%input#$theId$!name=$name$!type=date!:isReq:required!value=$val$ +%input#$theId$!name=$name$!:isReq:required!value=$val$ |] addScript' urlJqueryJs addScript' urlJqueryUiJs addScript' urlJqueryUiDateTimePicker addStylesheet' urlJqueryUiCss addJavaScript [$julius| -$$(function(){$$("#$name$").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 addStylesheet' urlJqueryUiCss addJavaScript [$julius| -$$(function(){$$("#$name$").autocomplete({source:"@src@",minLength:2})}); +$$(function(){$$("#$theId$").autocomplete({source:"@src@",minLength:2})}); |] } diff --git a/Yesod/Form/Nic.hs b/Yesod/Form/Nic.hs index d6d7c5b1..e3361548 100644 --- a/Yesod/Form/Nic.hs +++ b/Yesod/Form/Nic.hs @@ -29,7 +29,7 @@ nicHtmlFieldProfile = FieldProfile , fpWidget = \theId name val _isReq -> do addBody [$hamlet|%textarea.html#$theId$!name=$name$ $val$|] addScript' urlNicEdit - addJavaScript [$julius|bkLib.onDomLoaded(function(){new nicEditor({fullPanel:true}).panelInstance("$name$")});|] + addJavaScript [$julius|bkLib.onDomLoaded(function(){new nicEditor({fullPanel:true}).panelInstance("$theId$")});|] } addScript' :: (y -> Either (Route y) String) -> GWidget sub y ()