r3499 committed - Updating dev branch to latest trunk
Revision: 3499
Author: joern.zaefferer
Date: Wed Dec 16 10:33:56 2009
Log: Updating dev branch to latest trunk
http://code.google.com/p/jquery-ui/source/detail?r=3499
Added:
/branches/dev/demos/datepicker/animation.html
/branches/dev/tests/visual/slider/slider_ticket_4467.html
/branches/dev/ui/i18n/jquery.ui.datepicker-bs.js
Modified:
/branches/dev
/branches/dev/build/build.xml
/branches/dev/demos/datepicker/index.html
/branches/dev/demos/datepicker/localization.html
/branches/dev/demos/index.html
/branches/dev/tests/unit/datepicker/datepicker_core.js
/branches/dev/tests/unit/datepicker/datepicker_options.js
/branches/dev/ui/i18n/jquery.ui.datepicker-en-GB.js
/branches/dev/ui/jquery.ui.datepicker.js
/branches/dev/ui/jquery.ui.dialog.js
/branches/dev/ui/jquery.ui.position.js
=======================================
--- /dev/null
+++ /branches/dev/demos/datepicker/animation.html Wed Dec 16 10:33:56 2009
@@ -0,0 +1,54 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Datepicker - Animations</title>
+ <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
+ <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
+ <script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.core.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.blind.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.bounce.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.clip.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.drop.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.fold.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.effects.slide.js"></script>
+ <script type="text/javascript"
src="../../ui/jquery.ui.datepicker.js"></script>
+ <link type="text/css" href="../demos.css" rel="stylesheet" />
+ <script type="text/javascript">
+ $(function() {
+ $("#datepicker").datepicker();
+ $("#anim").change(function() { $('#datepicker').datepicker('option',
{showAnim: $(this).val()}); });
+ });
+ </script>
+</head>
+<body>
+
+<div class="demo">
+
+Date: <input type="text" id="datepicker" size="30"/>
+
+Animations:<br />
+ <select id="anim">
+ <option value="show">Show (default)</option>
+ <option value="slideDown">Slide down</option>
+ <option value="fadeIn">Fade in</option>
+ <!-- <option value="blind">Blind (UI Effect)</option>
+ <option value="bounce">Bounce (UI Effect)</option>
+ <option value="clip">Clip (UI Effect)</option>
+ <option value="drop">Drop (UI Effect)</option>
+ <option value="fold">Fold (UI Effect)</option>
+ <option value="slide">Slide (UI Effect)</option> -->
+ <option value="">None</option>
+ </select>
+
+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+Use different animations when opening or closing the datepicker.
Choose an animation from the dropdown, then click on the input to see its
effect. You can use one of the three standard animations or any of the UI
Effects.
+
+</div><!-- End demo-description -->
+
+</body>
+</html>
=======================================
--- /dev/null
+++ /branches/dev/tests/visual/slider/slider_ticket_4467.html Wed Dec 16
10:33:56 2009
@@ -0,0 +1,31 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Slider Visual Test : Slider ticket #4467</title>
+ <link rel="stylesheet" href="../visual.css" type="text/css" />
+ <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
+ <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
+ <script type="text/javascript"
src="../../../ui/jquery.ui.core.js"></script>
+ <script type="text/javascript"
src="../../../ui/jquery.ui.slider.js"></script>
+ <script type="text/javascript">
+ $(function() {
+ $("#slider").slider({
+ range: true,
+ values: [25, 75]
+ });
+ });
+ </script>
+ <style type="text/css">
+ .ui-slider-handle {
+ width: 100px !important;
+ }
+ </style>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a
href="http://dev.jqueryui.com/ticket/4467">#4467 - slider handle jumps few
pixels right or left if it's clicked on it</a></h1>
+
+<div id="slider"></div>
+
+</body>
+</html>
=======================================
--- /dev/null
+++ /branches/dev/ui/i18n/jquery.ui.datepicker-bs.js Wed Dec 16 10:33:56
2009
@@ -0,0 +1,23 @@
+/* Bosnian i18n for the jQuery UI date picker plugin. */
+/* Written by Kenan Konjo. */
+jQuery(function($){
+ $.datepicker.regional['bs'] = {
+ closeText: 'Zatvori',
+ prevText: '<',
+ nextText: '>',
+ currentText: 'Danas',
+ monthNames: ['Januar','Februar','Mart','April','Maj','Juni',
+ 'Juli','August','Septembar','Oktobar','Novembar','Decembar'],
+ monthNamesShort: ['Jan','Feb','Mar','Apr','Maj','Jun',
+ 'Jul','Aug','Sep','Okt','Nov','Dec'],
+ dayNames:
['Nedelja','Ponedeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
+ dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
+ dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
+ weekHeader: 'Wk',
+ dateFormat: 'dd.mm.yy',
+ firstDay: 1,
+ isRTL: false,
+ showMonthAfterYear: false,
+ yearSuffix: ''};
+ $.datepicker.setDefaults($.datepicker.regional['bs']);
+});
=======================================
--- /branches/dev/build/build.xml Wed Nov 18 10:13:25 2009
+++ /branches/dev/build/build.xml Wed Dec 16 10:33:56 2009
@@ -59,8 +59,7 @@
<for param="file">
<path><fileset dir="${dist.dir}/ui/minified/" includes="*.js" /></path>
<sequential>
- <basename file="@{file}" property="target" />
- <propertyregex override="yes" property="target" input="${target}"
regexp="(.+)\.min\.js$" replace="\1"/>
+ <propertyregex override="yes" property="target" input="@{file}"
regexp=".*[\\/](.+)\.min\.js$" replace="\1"/>
<concat destfile="${dist.dir}/ui-headered/${target}.min.js">
<header file="${dist.dir}/headers/${target}.js" />
<fileset file="@{file}" />
=======================================
--- /branches/dev/demos/datepicker/index.html Wed Jul 29 01:33:33 2009
+++ /branches/dev/demos/datepicker/index.html Wed Dec 16 10:33:56 2009
@@ -21,6 +21,7 @@
<li><a href="show-week.html">Show week of the year</a></li>
<li><a href="multiple-calendars.html">Display multiple months</a></li>
<li><a href="icon-trigger.html">Icon trigger</a></li>
+ <li><a href="animation.html">Animations</a></li>
<li><a href="event-search.html">Event Search</a></li>
</ul>
</div>
=======================================
--- /branches/dev/demos/datepicker/localization.html Sun Oct 25 03:27:04
2009
+++ /branches/dev/demos/datepicker/localization.html Wed Dec 16 10:33:56
2009
@@ -10,6 +10,7 @@
<script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-ar.js"></script>
<script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-az.js"></script>
<script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-bg.js"></script>
+ <script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-bs.js"></script>
<script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-ca.js"></script>
<script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-cs.js"></script>
<script type="text/javascript"
src="../../ui/i18n/jquery.ui.datepicker-da.js"></script>
@@ -77,6 +78,7 @@
<option value="hy">Armenian
(Հայերեն)</option>
<option value="az">Azerbaijani (Azərbaycan dili)</option>
<option value="eu">Basque (Euskara)</option>
+ <option value="bs">Bosnian (Bosanski)</option>
<option value="bg">Bulgarian
(български
език)</option>
<option value="ca">Catalan (Català)</option>
<option value="zh-CN">Chinese Simplified
(简体中文)</option>
=======================================
--- /branches/dev/demos/index.html Wed Dec 16 09:55:04 2009
+++ /branches/dev/demos/index.html Wed Dec 16 10:33:56 2009
@@ -39,6 +39,7 @@
<script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-af.js"></script>
<script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-ar.js"></script>
<script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-az.js"></script>
+ <script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-bs.js"></script>
<script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-bg.js"></script>
<script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-ca.js"></script>
<script type="text/javascript"
src="../ui/i18n/jquery.ui.datepicker-cs.js"></script>
=======================================
--- /branches/dev/tests/unit/datepicker/datepicker_core.js Thu Oct 15
03:05:53 2009
+++ /branches/dev/tests/unit/datepicker/datepicker_core.js Wed Dec 16
10:33:56 2009
@@ -33,7 +33,7 @@
function init(id, options) {
$.datepicker.setDefaults($.datepicker.regional['']);
- return $(id).datepicker($.extend({duration: ''}, options || {}));
+ return $(id).datepicker($.extend({showAnim: ''}, options || {}));
}
var PROP_NAME = 'datepicker';
=======================================
--- /branches/dev/tests/unit/datepicker/datepicker_options.js Tue Sep 22
00:54:11 2009
+++ /branches/dev/tests/unit/datepicker/datepicker_options.js Wed Dec 16
10:33:56 2009
@@ -46,7 +46,7 @@
equals(inp.datepicker('option', 'showOn'), 'button', 'Change instance
showOn');
inp.datepicker('option', 'showOn', undefined);
equals(inp.datepicker('option', 'showOn'), 'focus', 'Reset instance
showOn');
- same(inp.datepicker('option', 'all'), {duration: ''}, 'Get instance
settings');
+ same(inp.datepicker('option', 'all'), {showAnim: ''}, 'Get instance
settings');
same(inp.datepicker('option', 'defaults'), $.datepicker._defaults,
'Get default settings');
});
@@ -267,14 +267,21 @@
}
return range;
};
+ var curYear = new Date().getFullYear();
inp.val('02/04/2008').datepicker('show');
equals(dp.find('.ui-datepicker-year').text(), '2008', 'Year range -
read-only default');
inp.datepicker('hide').datepicker('option', {changeYear:
true}).datepicker('show');
equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 10,
21), 'Year range - changeable default');
- inp.datepicker('hide').datepicker('option', {yearRange: '-6:+2',
changeYear: true}).datepicker('show');
- equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 6,
9), 'Year range - -6:+2');
+ inp.datepicker('hide').datepicker('option', {yearRange: 'c-6:c+2',
changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(2008 - 6,
9), 'Year range - c-6:c+2');
inp.datepicker('hide').datepicker('option', {yearRange: '2000:2010',
changeYear: true}).datepicker('show');
equals(dp.find('.ui-datepicker-year').text(), genRange(2000, 11), 'Year
range - 2000:2010');
+ inp.datepicker('hide').datepicker('option', {yearRange: '-5:+3',
changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(curYear - 5,
9), 'Year range - -5:+3');
+ inp.datepicker('hide').datepicker('option', {yearRange: '2000:-5',
changeYear: true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(2000, curYear -
2004), 'Year range - 2000:-5');
+ inp.datepicker('hide').datepicker('option', {yearRange: '', changeYear:
true}).datepicker('show');
+ equals(dp.find('.ui-datepicker-year').text(), genRange(curYear, 1), 'Year
range - -6:+2');
// Navigation as date format
inp.datepicker('option', {showButtonPanel: true});
=======================================
--- /branches/dev/ui/i18n/jquery.ui.datepicker-en-GB.js Sun Oct 25 03:27:04
2009
+++ /branches/dev/ui/i18n/jquery.ui.datepicker-en-GB.js Wed Dec 16 10:33:56
2009
@@ -2,7 +2,7 @@
/* Written by Stuart. */
jQuery(function($){
$.datepicker.regional['en-GB'] = {
- closeText: 'Clear',
+ closeText: 'Done',
prevText: 'Prev',
nextText: 'Next',
currentText: 'Today',
=======================================
--- /branches/dev/ui/jquery.ui.datepicker.js Thu Oct 15 03:05:53 2009
+++ /branches/dev/ui/jquery.ui.datepicker.js Wed Dec 16 10:33:56 2009
@@ -16,6 +16,7 @@
$.extend($.ui, { datepicker: { version: "@VERSION" } });
var PROP_NAME = 'datepicker';
+var dpuuid = new Date().getTime();
/* Date picker manager.
Use the singleton instance of this class, $.datepicker, to interact
with the date picker.
@@ -74,8 +75,9 @@
gotoCurrent: false, // True if today link goes back to current selection
instead
changeMonth: false, // True if month can be selected directly, false if
only prev/next
changeYear: false, // True if year can be selected directly, false if
only prev/next
- yearRange: '-10:+10', // Range of years to display in drop-down,
- // either relative to current year (-nn:+nn) or absolute (nnnn:nnnn)
+ yearRange: 'c-10:c+10', // Range of years to display in drop-down,
+ // either relative to today's year (-nn:+nn), relative to currently
displayed year
+ // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above
(nnnn:-n)
showOtherMonths: false, // True to show dates in other months, false to
leave blank
selectOtherMonths: false, // True to allow selection of dates in other
months, false for unselectable
showWeek: false, // True to show week of the year, false to not show it
@@ -164,7 +166,7 @@
/* Create a new instance object. */
_newInst: function(target, inline) {
- var id = target[0].id.replace(/([:\[\]\.\$])/g, '\\\\$1'); // escape
jQuery meta chars
+ var id = target[0].id.replace(/([^A-Za-z0-9_])/g, '\\\\$1'); // escape
jQuery meta chars
return {id: id, input: target, // associated target
selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection
drawMonth: 0, drawYear: 0, // month being drawn
@@ -426,7 +428,7 @@
}
if (inst) {
if (this._curInst == inst) {
- this._hideDatepicker(null);
+ this._hideDatepicker();
}
var date = this._getDateDatepicker(target);
extendRemove(inst.settings, settings);
@@ -480,17 +482,18 @@
inst._keyEvent = true;
if ($.datepicker._datepickerShowing)
switch (event.keyCode) {
- case 9: $.datepicker._hideDatepicker(null, '');
+ case 9: $.datepicker._hideDatepicker();
+ handled = false;
break; // hide on tab out
- case 13: var sel = $('td.' + $.datepicker._dayOverClass +
- ', td.' + $.datepicker._currentClass, inst.dpDiv);
+ case 13: var sel = $('td.' + $.datepicker._dayOverClass, inst.dpDiv).
+ add($('td.' + $.datepicker._currentClass, inst.dpDiv));
if (sel[0])
$.datepicker._selectDay(event.target, inst.selectedMonth,
inst.selectedYear, sel[0]);
else
- $.datepicker._hideDatepicker(null,
$.datepicker._get(inst, 'duration'));
+ $.datepicker._hideDatepicker();
return false; // don't submit the form
break; // select the value on enter
- case 27: $.datepicker._hideDatepicker(null,
$.datepicker._get(inst, 'duration'));
+ case 27: $.datepicker._hideDatepicker();
break; // hide on escape
case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
-$.datepicker._get(inst, 'stepBigMonths') :
@@ -554,19 +557,21 @@
/* Synchronise manual entry and field/alternate field. */
_doKeyUp: function(event) {
var inst = $.datepicker._getInst(event.target);
- try {
- var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
- (inst.input ? inst.input.val() : null),
- $.datepicker._getFormatConfig(inst));
- if (date) { // only if valid
- $.datepicker._setDateFromField(inst);
- $.datepicker._updateAlternate(inst);
- $.datepicker._updateDatepicker(inst);
+ if (inst.input.val() != inst.lastVal) {
+ try {
+ var date =
$.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
+ (inst.input ? inst.input.val() : null),
+ $.datepicker._getFormatConfig(inst));
+ if (date) { // only if valid
+ $.datepicker._setDateFromField(inst);
+ $.datepicker._updateAlternate(inst);
+ $.datepicker._updateDatepicker(inst);
+ }
+ }
+ catch (event) {
+ $.datepicker.log(event);
}
}
- catch (event) {
- $.datepicker.log(event);
- }
return true;
},
@@ -580,9 +585,11 @@
if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput
== input) // already here
return;
var inst = $.datepicker._getInst(input);
+ if ($.datepicker._curInst && $.datepicker._curInst != inst) {
+ $.datepicker._curInst.dpDiv.stop(true, true);
+ }
var beforeShow = $.datepicker._get(inst, 'beforeShow');
extendRemove(inst.settings, (beforeShow ? beforeShow.apply(input,
[input, inst]) : {}));
- $.datepicker._hideDatepicker(null, '');
$.datepicker._lastInput = input;
$.datepicker._setDateFromField(inst);
if ($.datepicker._inDialog) // hide cursor
@@ -612,7 +619,7 @@
'static' : (isFixed ? 'fixed' : 'absolute')), display: 'none',
left: offset.left + 'px', top: offset.top + 'px'});
if (!inst.inline) {
- var showAnim = $.datepicker._get(inst, 'showAnim') || 'show';
+ var showAnim = $.datepicker._get(inst, 'showAnim');
var duration = $.datepicker._get(inst, 'duration');
var postProcess = function() {
$.datepicker._datepickerShowing = true;
@@ -624,8 +631,8 @@
if ($.effects && $.effects[showAnim])
inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'),
duration, postProcess);
else
- inst.dpDiv[showAnim](duration, postProcess);
- if (duration == '')
+ inst.dpDiv[showAnim || 'show']((showAnim ? duration : ''),
postProcess);
+ if (!showAnim)
postProcess();
if (inst.input[0].type != 'hidden')
inst.input[0].focus();
@@ -718,26 +725,25 @@
},
/* Hide the date picker from view.
- @param input element - the input field attached to the date picker
- @param duration string - the duration over which to close the date
picker */
- _hideDatepicker: function(input, duration) {
+ @param input element - the input field attached to the date picker */
+ _hideDatepicker: function(input) {
var inst = this._curInst;
if (!inst || (input && inst != $.data(input, PROP_NAME)))
return;
if (this._datepickerShowing) {
- duration = (duration != null ? duration : this._get(inst, 'duration'));
var showAnim = this._get(inst, 'showAnim');
+ var duration = this._get(inst, 'duration');
var postProcess = function() {
$.datepicker._tidyDialog(inst);
+ this._curInst = null;
};
- if (duration != '' && $.effects && $.effects[showAnim])
- inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
- duration, postProcess);
+ if ($.effects && $.effects[showAnim])
+ inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'),
duration, postProcess);
else
- inst.dpDiv