[otrs-cvs] ITSMCore/var/httpd/htdocs/js ITSM.Agent.CustomerSearch.js, 1.6, 1.7
"CVS commits notifications of OTRS.org" <[email protected]> Wed, 10 Jul 2013 17:18:07 +0000
| Newsgroups | gmane.comp.otrs.cvs |
|---|---|
| Message-ID | <[email protected]> |
Comments:
Update of /home/cvs/ITSMCore/var/httpd/htdocs/js
In directory lancelot:/tmp/cvs-serv15162/var/httpd/htdocs/js
Modified Files:
ITSM.Agent.CustomerSearch.js
Log Message:
Improved escaping of colons (:) in HTML IDs by using Core.App.EscapeSelector function.
Author: ub
Index: ITSM.Agent.CustomerSearch.js
===================================================================
RCS file: /home/cvs/ITSMCore/var/httpd/htdocs/js/ITSM.Agent.CustomerSearch.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -2 -u -d -r1.6 -r1.7
--- ITSM.Agent.CustomerSearch.js 1 Dec 2011 14:00:33 -0000 1.6
+++ ITSM.Agent.CustomerSearch.js 10 Jul 2013 17:18:02 -0000 1.7
@@ -1,5 +1,5 @@
// --
// ITSM.Agent.CustomerSearch.js - provides the special module functions for the customer search
-// Copyright (C) 2001-2011 OTRS AG, http://otrs.org/\n";
+// Copyright (C) 2001-2013 OTRS AG, http://otrs.org/\n";
// --
// $Id$
@@ -73,7 +73,6 @@
// set hidden field SelectedCustomerUser
- // escape : with two leading backslashes in front of each :
- // this is necessary because jQuery can not handle a colon (:) in id attributes
- $('#' + $Element.attr('id').replace(/:/g, '\\:') + 'Selected').val(CustomerKey);
+ // escape possible colons (:) in element id because jQuery can not handle it in id attribute selectors
+ $('#' + Core.App.EscapeSelector($Element.attr('id')) + 'Selected').val(CustomerKey);
return false;
@@ -84,7 +83,6 @@
$Element.after('<button id="' + $Element.attr('id') + 'Search" type="button">' + Core.Config.Get('CustomerAutocomplete.SearchButtonText') + '</button>');
- // escape : with two leading backslashes in front of each :
- // this is necessary because jQuery can not handle a colon (:) in id attributes
- $('#' + $Element.attr('id').replace(/:/g, '\\:') + 'Search').click(function () {
+ // escape possible colons (:) in element id because jQuery can not handle it in id attribute selectors
+ $('#' + Core.App.EscapeSelector($Element.attr('id')) + 'Search').click(function () {
$Element.autocomplete("option", "minLength", 0);
$Element.autocomplete("search");
@@ -96,7 +94,6 @@
// On unload remove old selected data. If the page is reloaded (with F5) this data stays in the field and invokes an ajax request otherwise
$(window).bind('unload', function () {
- // escape : with two leading backslashes in front of each :
- // this is necessary because jQuery can not handle a colon (:) in id attributes
- $('#' + $Element.attr('id').replace(/:/g, '\\:') + 'Selected').val('');
+ // escape possible colons (:) in element id because jQuery can not handle it in id attribute selectors
+ $('#' + Core.App.EscapeSelector($Element.attr('id')) + 'Selected').val('');
});
};
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log