[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-952-ga973a5d
Thomas Sibley
trs at bestpractical.com
Mon Dec 20 14:39:55 EST 2010
The branch, 3.9-trunk has been updated
via a973a5da438f3c0f2100d2d1539fdd2781050bc7 (commit)
from 4a0ebf8042f76969b15c7b60b64f26ea97bb8a2c (commit)
Summary of changes:
etc/RT_Config.pm.in | 1 +
share/html/NoAuth/js/jquery-ui-patch-datepicker.js | 14 ++++++++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
create mode 100644 share/html/NoAuth/js/jquery-ui-patch-datepicker.js
- Log -----------------------------------------------------------------
commit a973a5da438f3c0f2100d2d1539fdd2781050bc7
Author: Thomas Sibley <trs at bestpractical.com>
Date: Mon Dec 20 14:34:24 2010 -0500
Monkey-patch jQuery UI's datepicker to handle IDs containing single quotes
Query builder inputs for date and datetime CFs have IDs like:
ValueOf'CF.{Name of Field}'
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 1b33f30..2390137 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2205,6 +2205,7 @@ Set(@JSFilesInHead, qw/
jquery_noconflict.js
jquery-ui-1.8.4.custom.min.js
jquery.tablesorter.min.js
+ jquery-ui-patch-datepicker.js
ui.timepickr.js
titlebox-state.js
util.js
diff --git a/share/html/NoAuth/js/jquery-ui-patch-datepicker.js b/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
new file mode 100644
index 0000000..c612fc1
--- /dev/null
+++ b/share/html/NoAuth/js/jquery-ui-patch-datepicker.js
@@ -0,0 +1,14 @@
+(function($){
+ $.datepicker._newInst_orig = $.datepicker._newInst;
+ $.datepicker._newInst = function(target, inline) {
+ var data = this._newInst_orig(target, inline);
+
+ // Escape single quotes to avoid incorrect quoting in onclick handlers
+ // when other datepicker code interpolates inst.id. They'll already be
+ // escaped by the original _newInst for handing to jQuery's CSS
+ // selector parser.
+ data.id = data.id.replace(/'/g, "\\'");
+
+ return data;
+ };
+})(jQuery);
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list