Bug Tracker

Modify

Ticket #1949 (closed bug: fixed)

Opened 6 years ago

Last modified 5 years ago

UI's popup calendar contains HTML entities

Reported by: pytechd Owned by:
Priority: minor Milestone: 1.2.2
Component: ui Version: 1.2.1
Keywords: Cc:
Blocking: Blocked by:

Description

By default, the popup calendar cannot be used in XML pages delivered as application/xhtml+xml under Firefox 2.0 or 3.0. The problem is that the HTML fragment inserted contains HTML entities, which don't work in innerHTML. The calendar throws an "Invalid Entity" exception.

Fortunately, it's an easy fix, backwards compatible, and compatible with any browser that jQuery supports.

Index: ui.cal.js
===================================================================
--- ui.cal.js	(revision 1244)
+++ ui.cal.js	(working copy)
@@ -25,8 +25,8 @@
 	this.regional[''] = { // Default regional settings
 		clearText: 'Clear', // Display text for clear link
 		closeText: 'Close', // Display text for close link
-		prevText: '<Prev', // Display text for previous month link
-		nextText: 'Next>', // Display text for next month link
+		prevText: '<Prev', // Display text for previous month link
+		nextText: 'Next>', // Display text for next month link
 		currentText: 'Today', // Display text for current month link
 		dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], // Names of days starting at Sunday
 		dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
@@ -1182,7 +1182,7 @@
 						(unselectable ? '' : ' onmouseover="jQuery(this).addClass(\'datepicker_daysCellOver\');"' +
 						' onmouseout="jQuery(this).removeClass(\'datepicker_daysCellOver\');"' +
 						' onclick="jQuery.datepicker._selectDay(' + this._id + ',' + drawMonth + ',' + drawYear + ', this);"') + '>' + // actions
-						(otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months
+						(otherMonth ? (showOtherMonths ? printDate.getDate() : ' ') : // display for other months
 						(unselectable ? printDate.getDate() : '<a>' + printDate.getDate() + '</a>')) + '</td>'; // display for this month
 					printDate.setDate(printDate.getDate() + 1);
 				}

Change History

comment:1 Changed 6 years ago by kbwood

Changed named entities to character entities

comment:2 Changed 5 years ago by paul

  • Status changed from new to closed
  • Resolution set to fixed

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.