diff --git a/MIT-LICENSE.txt b/MIT-LICENSE.txt index 2585de262e3..be226805d36 100644 --- a/MIT-LICENSE.txt +++ b/MIT-LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2010 Paul Bakaus, http://jqueryui.com/ +Copyright (c) 2011 Paul Bakaus, http://jqueryui.com/ This software consists of voluntary contributions made by many individuals (AUTHORS.txt, http://jqueryui.com/about) For exact diff --git a/build/build.xml b/build/build.xml index 4ebe6984c6a..568cc9c923f 100644 --- a/build/build.xml +++ b/build/build.xml @@ -271,7 +271,6 @@ - diff --git a/build/build/yuicompressor-2.4.2.jar b/build/build/yuicompressor-2.4.2.jar deleted file mode 100644 index c29470bd0d0..00000000000 Binary files a/build/build/yuicompressor-2.4.2.jar and /dev/null differ diff --git a/build/release/prepare-release b/build/release/prepare-release index 91665e1eb7a..6947f57940c 100755 --- a/build/release/prepare-release +++ b/build/release/prepare-release @@ -5,7 +5,8 @@ repo_dir="$base_dir/jquery-ui" release_dir="$repo_dir/build/release" github_repo="git@github.com:jquery/jquery-ui.git" -remote_cmd="ssh jqadmin@ui-dev.jquery.com /srv/dev.jqueryui.com/prepare-release" +git_branch="1-8-stable" +trac_url="http://bugs.jqueryui.com" @@ -25,6 +26,7 @@ cd $base_dir echo "Cloning repo from $github_repo..." git clone $github_repo cd $repo_dir +git checkout $git_branch echo echo "Environment setup complete." @@ -43,11 +45,12 @@ echo "------------------------" echo # NOTE: this will be different for minor and major releases -version=`$remote_cmd/get-latest-version` -major_minor=${version%.*} -point=${version##*.} -version_new="${major_minor}.$(($point + 1))" -version_next=`cat version.txt` +version_new=`cat version.txt` +version_new=${version_new:0:$((${#version_new} - 3))} +major_minor=${version_new%.*} +point=${version_new##*.} +version="${major_minor}.$(($point - 1))" +version_next="${major_minor}.$(($point + 1))pre" echo "We are going from $version to $version_new." echo "version.txt will be set to $version_next when complete." @@ -85,7 +88,9 @@ git whatchanged $version... --pretty=format:"$format_full" \ # find all fixed tickets echo "Adding Trac tickets to changelog..." -$remote_cmd/generate-changelog >> $base_dir/changelog +trac_changelog="$trac_url/query?format=tab&milestone=$version_new" +trac_changelog="$trac_changelog&resolution=fixed&col=id&col=component&col=summary&order=component" +curl $trac_changelog >> $base_dir/changelog echo echo "Changelog complete." @@ -114,11 +119,11 @@ git whatchanged $version... --pretty=format:"$format_contributors" \ # find all reporters and commenters from Trac echo "Adding reporters and commenters from Trac..." -$remote_cmd/generate-contributors >> $base_dir/thankyou +curl "$trac_url/report/22?V=$version_new&max=-1&format=tab" | tail -n +2 >> $base_dir/thankyou # sort names echo "Sorting contributors..." -LC_ALL='C' sort -f $base_dir/thankyou | uniq > $base_dir/_thankyou +LC_ALL='C' sort -f $base_dir/thankyou | col -b | uniq > $base_dir/_thankyou mv $base_dir/_thankyou $base_dir/thankyou # find all people that were thanked @@ -162,7 +167,7 @@ git tag $version_new echo "Updating version.txt to $version_next..." echo $version_next > version.txt -git commit -a -m "Updating the master version to $version_next" +git commit -a -m "Updating the $git_branch version to $version_next" echo "Committed version.txt..." echo @@ -206,7 +211,6 @@ echo # TODO: automate this # NOTE: this will be different for minor and major releases -milestone=`$remote_cmd/get-latest-milestone` # Create new milestrone and version echo "$version_new was tagged at $version_new_time." @@ -215,11 +219,6 @@ echo "Create the $version_new Version with the above date and time." echo "Press enter when done." read -# Update milestone for all fixed tickets -echo "Change all $milestone fixed tickets to $version_new." -echo "Press enter when done." -read - echo echo "Trac updates complete." echo diff --git a/demos/autocomplete/categories.html b/demos/autocomplete/categories.html index 163c969dd74..494445b259f 100644 --- a/demos/autocomplete/categories.html +++ b/demos/autocomplete/categories.html @@ -8,7 +8,6 @@ -
-
-
- - -
- -
+
+ + +
- -

An example of a split button built with two buttons: A plain button with just text, one with only a primary icon -and no text. Both are grouped together in a set.

- +

An example of a split button built with two buttons: A plan button with just text, one with only a primary icon and no text. Both are grouped together in a set.

diff --git a/demos/datepicker/date-range.html b/demos/datepicker/date-range.html index 1e3beb2a25c..6bce3f776d5 100644 --- a/demos/datepicker/date-range.html +++ b/demos/datepicker/date-range.html @@ -17,7 +17,7 @@ numberOfMonths: 3, onSelect: function( selectedDate ) { var option = this.id == "from" ? "minDate" : "maxDate", - instance = $( this ).data( "datepicker" ); + instance = $( this ).data( "datepicker" ), date = $.datepicker.parseDate( instance.settings.dateFormat || $.datepicker._defaults.dateFormat, diff --git a/demos/datepicker/localization.html b/demos/datepicker/localization.html index 9d32a486347..767cdaa54a7 100644 --- a/demos/datepicker/localization.html +++ b/demos/datepicker/localization.html @@ -10,6 +10,7 @@ + @@ -18,7 +19,9 @@ + + @@ -41,12 +44,14 @@ + + @@ -83,6 +88,7 @@ - - - - -

-

- - -

- - -
-

- Example of a donation form, with currency selection and amout spinner. -

-
- - - diff --git a/demos/spinner/decimal.html b/demos/spinner/decimal.html deleted file mode 100644 index ae45da1e7f1..00000000000 --- a/demos/spinner/decimal.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - jQuery UI Spinner - decimal - - - - - - - - - - - - - - - -
-

- - -

-

- - -

-
- -
-

- Example of a decimal spinner. Step is set to 0.01. -
The code handling the culture change reads the current spinner value, - then changes the culture, then sets the value again, resulting in an updated - formatting, based on the new culture. -

-
- - - diff --git a/demos/spinner/default.html b/demos/spinner/default.html deleted file mode 100644 index b0f62308d7e..00000000000 --- a/demos/spinner/default.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - jQuery UI Spinner - Default functionality - - - - - - - - - - - - -
- -

-

- -

- - -

- -

- - -

- -
- -
-

-Default spinner. -

-
- - - diff --git a/demos/spinner/index.html b/demos/spinner/index.html deleted file mode 100644 index a49fa13685f..00000000000 --- a/demos/spinner/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - jQuery UI Spinner Demos - - - -
-

Examples

- -
- - diff --git a/demos/spinner/latlong.html b/demos/spinner/latlong.html deleted file mode 100644 index 7c0c9b21a6e..00000000000 --- a/demos/spinner/latlong.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - jQuery UI Spinner - Map - - - - - - - - - - - - - - -
- - - -
- - - -
- -
- -
-

-Google Maps integration, using spinners to change latidude and longitude. -

-
- - - diff --git a/demos/spinner/overflow.html b/demos/spinner/overflow.html deleted file mode 100644 index 71648915527..00000000000 --- a/demos/spinner/overflow.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - jQuery UI Spinner - Default functionality - - - - - - - - - - - - -
-

- - -

-
- -
-

- Overflowing spinner restricted to a range of -10 to 10. - For anything above 10, it'll overflow to -10, and the other way round. -

-
- - - diff --git a/demos/spinner/time.html b/demos/spinner/time.html deleted file mode 100644 index 3f1efcad26c..00000000000 --- a/demos/spinner/time.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - jQuery UI Spinner - decimal - - - - - - - - - - - - - - -
-

- - -

-

- - -

-
- -
-

- A custom widget extending spinner. Use the Globalization plugin to parse and output - a timestamp, with custom step and page options. Cursor up/down spins minutes, page up/down - spins hours. -

-
- - - diff --git a/demos/switchClass/index.html b/demos/switchClass/index.html index f5bd6a0e424..0e9af371fea 100644 --- a/demos/switchClass/index.html +++ b/demos/switchClass/index.html @@ -1,9 +1,9 @@ - + jQuery UI Effects Demos - + diff --git a/demos/tabs/ajax/content1.html b/demos/tabs/ajax/content1.html index 472bdfb366b..759bf134ec9 100644 --- a/demos/tabs/ajax/content1.html +++ b/demos/tabs/ajax/content1.html @@ -1,4 +1,4 @@ -

This content was loaded via ajax.

+

This content was loaded via ajax.

Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.

Mauris vitae ante. Curabitur augue. Nulla purus nibh, lobortis ut, feugiat at, aliquam id, purus. Sed venenatis, lorem venenatis volutpat commodo, purus quam lacinia justo, mattis interdum pede pede a odio. Fusce nibh. Morbi nisl mauris, dapibus in, tristique eget, accumsan et, pede. Donec mauris risus, pulvinar ut, faucibus eu, mollis in, nunc. In augue massa, commodo a, cursus vehicula, varius eu, dui. Suspendisse sodales suscipit lorem. Morbi malesuada, eros quis condimentum dignissim, lectus nibh tristique urna, non bibendum diam massa vel risus. Morbi suscipit. Proin egestas, eros at scelerisque scelerisque, dolor lacus fringilla lacus, ut ullamcorper mi magna at quam. Aliquam sed elit. Aliquam turpis purus, congue quis, iaculis id, ullamcorper sit amet, justo. Maecenas sed mauris. Proin magna justo, interdum in, tincidunt eu, viverra eu, turpis. Suspendisse mollis. In magna. Phasellus pellentesque, urna pellentesque convallis pellentesque, augue sem blandit pede, at rhoncus libero nisl a odio.

Sed vitae nibh non magna semper tempor. Duis dolor. Nam congue laoreet arcu. Fusce lobortis enim quis ligula. Maecenas commodo odio id mi. Maecenas scelerisque tellus eu odio. Etiam dolor purus, lacinia a, imperdiet in, aliquam et, eros. In pellentesque. Nullam ac massa. Integer et turpis. Ut quam augue, congue non, imperdiet id, eleifend ac, nisi. Etiam ac arcu. Cras iaculis accumsan erat. Nullam vulputate sapien nec nisi pretium rhoncus. Aliquam a nibh. Vivamus est ante, fermentum a, tincidunt ut, imperdiet nec, velit. Aenean non tortor. Sed nec mauris eget tellus condimentum rutrum.

\ No newline at end of file diff --git a/demos/tabs/ajax/content2.html b/demos/tabs/ajax/content2.html index 18b03e40baa..95c25dae07d 100644 --- a/demos/tabs/ajax/content2.html +++ b/demos/tabs/ajax/content2.html @@ -1,4 +1,4 @@ -

This other content was loaded via ajax.

+

This other content was loaded via ajax.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nec turpis justo, et facilisis ligula. In congue interdum odio, a scelerisque eros posuere ac. Aenean massa tellus, dictum sit amet laoreet ut, aliquam in orci. Duis eu aliquam ligula. Nullam vel placerat ligula. Fusce venenatis viverra dictum. Phasellus dui dolor, imperdiet in sodales at, mattis sed libero. Morbi ac ipsum ligula. Quisque suscipit dui vel diam pretium nec cursus lacus malesuada. Donec sollicitudin, eros eget dignissim mollis, risus leo feugiat tellus, vel posuere nisl ipsum eu erat. Quisque posuere lacinia imperdiet. Quisque nunc leo, elementum quis ultricies et, vehicula sit amet turpis. Nullam sed nunc nec nibh condimentum mattis. Quisque sed ligula sit amet nisi ultricies bibendum eget id nisi.

Proin ut erat vel nunc tincidunt commodo. Curabitur feugiat, nisi et vehicula viverra, nisl orci eleifend arcu, sed blandit lectus nisl quis nisi. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Aenean rutrum gravida velit ac imperdiet. Integer vitae arcu risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin tincidunt orci at leo egestas porta. Vivamus ac augue et enim bibendum hendrerit ut id urna. Donec sollicitudin pulvinar turpis vitae scelerisque. Etiam tempor porttitor est sed blandit. Phasellus varius consequat leo eget tincidunt. Aliquam ac dui lectus. In et consectetur orci. Duis posuere nulla ac turpis faucibus vestibulum. Sed ut velit et dolor rhoncus dapibus. Sed sit amet pellentesque est.

Nam in volutpat orci. Morbi sit amet orci in erat egestas dignissim. Etiam mi sapien, tempus sed iaculis a, adipiscing quis tellus. Suspendisse potenti. Nam malesuada tristique vestibulum. In tempor tellus dignissim neque consectetur eu vestibulum nisl pellentesque. Phasellus ultrices cursus velit, id aliquam nisl fringilla quis. Cras varius elit sed urna ultrices congue. Sed ornare odio sed velit pellentesque id varius nisl sodales. Sed auctor ligula egestas mi pharetra ut consectetur erat pharetra.

\ No newline at end of file diff --git a/demos/tabs/ajax/content3-slow.php b/demos/tabs/ajax/content3-slow.php index 7ad43ec06bd..9e50dc3acb2 100644 --- a/demos/tabs/ajax/content3-slow.php +++ b/demos/tabs/ajax/content3-slow.php @@ -1,7 +1,7 @@ -

This content was loaded via ajax, though it took a second.

+

This content was loaded via ajax, though it took a second.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean nec turpis justo, et facilisis ligula. In congue interdum odio, a scelerisque eros posuere ac. Aenean massa tellus, dictum sit amet laoreet ut, aliquam in orci. Duis eu aliquam ligula. Nullam vel placerat ligula. Fusce venenatis viverra dictum. Phasellus dui dolor, imperdiet in sodales at, mattis sed libero. Morbi ac ipsum ligula. Quisque suscipit dui vel diam pretium nec cursus lacus malesuada. Donec sollicitudin, eros eget dignissim mollis, risus leo feugiat tellus, vel posuere nisl ipsum eu erat. Quisque posuere lacinia imperdiet. Quisque nunc leo, elementum quis ultricies et, vehicula sit amet turpis. Nullam sed nunc nec nibh condimentum mattis. Quisque sed ligula sit amet nisi ultricies bibendum eget id nisi.

Proin ut erat vel nunc tincidunt commodo. Curabitur feugiat, nisi et vehicula viverra, nisl orci eleifend arcu, sed blandit lectus nisl quis nisi. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Aenean rutrum gravida velit ac imperdiet. Integer vitae arcu risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin tincidunt orci at leo egestas porta. Vivamus ac augue et enim bibendum hendrerit ut id urna. Donec sollicitudin pulvinar turpis vitae scelerisque. Etiam tempor porttitor est sed blandit. Phasellus varius consequat leo eget tincidunt. Aliquam ac dui lectus. In et consectetur orci. Duis posuere nulla ac turpis faucibus vestibulum. Sed ut velit et dolor rhoncus dapibus. Sed sit amet pellentesque est.

Nam in volutpat orci. Morbi sit amet orci in erat egestas dignissim. Etiam mi sapien, tempus sed iaculis a, adipiscing quis tellus. Suspendisse potenti. Nam malesuada tristique vestibulum. In tempor tellus dignissim neque consectetur eu vestibulum nisl pellentesque. Phasellus ultrices cursus velit, id aliquam nisl fringilla quis. Cras varius elit sed urna ultrices congue. Sed ornare odio sed velit pellentesque id varius nisl sodales. Sed auctor ligula egestas mi pharetra ut consectetur erat pharetra.

\ No newline at end of file diff --git a/demos/tabs/index.html b/demos/tabs/index.html index c0d66843510..8fc417a4ffa 100644 --- a/demos/tabs/index.html +++ b/demos/tabs/index.html @@ -1,9 +1,9 @@ - + jQuery UI Tabs Demos - + diff --git a/demos/toggle/index.html b/demos/toggle/index.html index f5bd6a0e424..0e9af371fea 100644 --- a/demos/toggle/index.html +++ b/demos/toggle/index.html @@ -1,9 +1,9 @@ - + jQuery UI Effects Demos - + diff --git a/demos/toggleClass/index.html b/demos/toggleClass/index.html index f5bd6a0e424..0e9af371fea 100644 --- a/demos/toggleClass/index.html +++ b/demos/toggleClass/index.html @@ -1,9 +1,9 @@ - + jQuery UI Effects Demos - + diff --git a/demos/tooltip/ajax/content1.html b/demos/tooltip/ajax/content1.html deleted file mode 100644 index a1401b26da5..00000000000 --- a/demos/tooltip/ajax/content1.html +++ /dev/null @@ -1 +0,0 @@ -

This content was loaded via ajax.

\ No newline at end of file diff --git a/demos/tooltip/ajax/content2.html b/demos/tooltip/ajax/content2.html deleted file mode 100644 index f4132d731bf..00000000000 --- a/demos/tooltip/ajax/content2.html +++ /dev/null @@ -1 +0,0 @@ -

This other content was loaded via ajax.

\ No newline at end of file diff --git a/demos/tooltip/custom-animation.html b/demos/tooltip/custom-animation.html deleted file mode 100644 index eb6f3e03802..00000000000 --- a/demos/tooltip/custom-animation.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - jQuery UI Tooltip - Custom animation demo - - - - - - - - - - - - -
- -

Tooltips can be attached to any element. When you hover - the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip. -

-

But as it's not a native tooltip, it can be styled. Any themes built with - ThemeRoller - will also style tooltip's accordingly.

-

Tooltip's are also useful for form elements, to show some additional information in the context of each field.

-

-

Click the field to see the tooltip; when you tab out of the field, it gets hidden.

- -
- - - -
- -

Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.

- -
- - - - - diff --git a/demos/tooltip/default.html b/demos/tooltip/default.html deleted file mode 100644 index a0d61147fdf..00000000000 --- a/demos/tooltip/default.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - jQuery UI Tooltip - Default demo - - - - - - - - - - - - -
- -

Tooltips can be attached to any element. When you hover - the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip. -

-

But as it's not a native tooltip, it can be styled. Any themes built with - ThemeRoller - will also style tooltip's accordingly.

-

Tooltip's are also useful for form elements, to show some additional information in the context of each field.

-

-

Click the field to see the tooltip; when you tab out of the field, it gets hidden.

- -
- - - -
- -

Hover the links above or use the tab key to cycle the focus on each element.

- -
- - - - - diff --git a/demos/tooltip/delegation-mixbag.html b/demos/tooltip/delegation-mixbag.html deleted file mode 100644 index 05d3e0fc9e5..00000000000 --- a/demos/tooltip/delegation-mixbag.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - jQuery UI Tooltip - Default demo - - - - - - - - - - - - -
- - - - - -
-
This is the footnote, including other elements
-
This is the other footnote, including other elements
-
-
- - - -
- -

Show how to combine different event delegated tooltips into a single instance, by customizing the items and content options.

- -
- - - - - diff --git a/demos/tooltip/forms.html b/demos/tooltip/forms.html deleted file mode 100644 index 46ab4e9dcee..00000000000 --- a/demos/tooltip/forms.html +++ /dev/null @@ -1,71 +0,0 @@ - - - - jQuery UI Tooltip - Default demo - - - - - - - - - - - - - -
- -
-
-
- - - ? -
-
- - - ? -
-
- - - ? -
-
-
- -
- - - -
- -

Use the button below to display the help texts. Click again to hide them. Default hover and focus events are removed to show tooltip only programmatically.

- -

A fixed width is defined in CSS to make the tooltips look consistent when displayed all at once.

- -
- - - - - diff --git a/demos/tooltip/index.html b/demos/tooltip/index.html deleted file mode 100644 index 6bc9c1e5c76..00000000000 --- a/demos/tooltip/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - jQuery UI Tooltip Demos - - - - - - - - diff --git a/demos/tooltip/tracking.html b/demos/tooltip/tracking.html deleted file mode 100644 index 495d1aca996..00000000000 --- a/demos/tooltip/tracking.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - jQuery UI Tooltip - Default demo - - - - - - - - - - - - -
- -

Tooltips can be attached to any element. When you hover - the element with your mouse, the title attribute is displayed in a little box next to the element, just like a native tooltip. -

-

But as it's not a native tooltip, it can be styled. Any themes built with - ThemeRoller - will also style tooltip's accordingly.

-

Tooltip's are also useful for form elements, to show some additional information in the context of each field.

-

-

Click the field to see the tooltip; when you tab out of the field, it gets hidden.

- -
- - - -
- -

Here the tooltips are positioned relative to the mouse, and follow the mouse while it moves above the element.

- -
- - - - - diff --git a/external/glob.de-DE.js b/external/glob.de-DE.js deleted file mode 100644 index d68b84cc8c5..00000000000 --- a/external/glob.de-DE.js +++ /dev/null @@ -1,55 +0,0 @@ -(function($) { - var cultures = $.cultures, - en = cultures.en, - standard = en.calendars.standard, - culture = cultures["de-DE"] = $.extend(true, {}, en, { - name: "de-DE", - englishName: "German (Germany)", - nativeName: "Deutsch (Deutschland)", - language: "de", - numberFormat: { - ',': ".", - '.': ",", - percent: { - pattern: ["-n%","n%"], - ',': ".", - '.': "," - }, - currency: { - pattern: ["-n $","n $"], - ',': ".", - '.': ",", - symbol: "€" - } - }, - calendars: { - standard: $.extend(true, {}, standard, { - '/': ".", - firstDay: 1, - days: { - names: ["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"], - namesAbbr: ["So","Mo","Di","Mi","Do","Fr","Sa"], - namesShort: ["So","Mo","Di","Mi","Do","Fr","Sa"] - }, - months: { - names: ["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""], - namesAbbr: ["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""] - }, - AM: null, - PM: null, - eras: [{"name":"n. Chr.","start":null,"offset":0}], - patterns: { - d: "dd.MM.yyyy", - D: "dddd, d. MMMM yyyy", - t: "HH:mm", - T: "HH:mm:ss", - f: "dddd, d. MMMM yyyy HH:mm", - F: "dddd, d. MMMM yyyy HH:mm:ss", - M: "dd MMMM", - Y: "MMMM yyyy" - } - }) - } - }, cultures["de-DE"]); - culture.calendar = culture.calendars.standard; -})(Globalization); \ No newline at end of file diff --git a/external/glob.ja-JP.js b/external/glob.ja-JP.js deleted file mode 100644 index 454d478cb42..00000000000 --- a/external/glob.ja-JP.js +++ /dev/null @@ -1,74 +0,0 @@ -(function($) { - var cultures = $.cultures, - en = cultures.en, - standard = en.calendars.standard, - culture = cultures["ja-JP"] = $.extend(true, {}, en, { - name: "ja-JP", - englishName: "Japanese (Japan)", - nativeName: "日本語 (日本)", - language: "ja", - numberFormat: { - percent: { - pattern: ["-n%","n%"] - }, - currency: { - pattern: ["-$n","$n"], - decimals: 0, - symbol: "¥" - } - }, - calendars: { - standard: $.extend(true, {}, standard, { - days: { - names: ["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"], - namesAbbr: ["日","月","火","水","木","金","土"], - namesShort: ["日","月","火","水","木","金","土"] - }, - months: { - names: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""], - namesAbbr: ["1","2","3","4","5","6","7","8","9","10","11","12",""] - }, - AM: ["午前","午前","午前"], - PM: ["午後","午後","午後"], - eras: [{"name":"西暦","start":null,"offset":0}], - patterns: { - d: "yyyy/MM/dd", - D: "yyyy'年'M'月'd'日'", - t: "H:mm", - T: "H:mm:ss", - f: "yyyy'年'M'月'd'日' H:mm", - F: "yyyy'年'M'月'd'日' H:mm:ss", - M: "M'月'd'日'", - Y: "yyyy'年'M'月'" - } - }), - Japanese: $.extend(true, {}, standard, { - name: "Japanese", - days: { - names: ["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"], - namesAbbr: ["日","月","火","水","木","金","土"], - namesShort: ["日","月","火","水","木","金","土"] - }, - months: { - names: ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""], - namesAbbr: ["1","2","3","4","5","6","7","8","9","10","11","12",""] - }, - AM: ["午前","午前","午前"], - PM: ["午後","午後","午後"], - eras: [{"name":"平成","start":null,"offset":1867},{"name":"昭和","start":-1812153600000,"offset":1911},{"name":"大正","start":-1357603200000,"offset":1925},{"name":"明治","start":60022080000,"offset":1988}], - twoDigitYearMax: 99, - patterns: { - d: "gg y/M/d", - D: "gg y'年'M'月'd'日'", - t: "H:mm", - T: "H:mm:ss", - f: "gg y'年'M'月'd'日' H:mm", - F: "gg y'年'M'月'd'日' H:mm:ss", - M: "M'月'd'日'", - Y: "gg y'年'M'月'" - } - }) - } - }, cultures["ja-JP"]); - culture.calendar = culture.calendars.standard; -})(Globalization); \ No newline at end of file diff --git a/external/glob.js b/external/glob.js deleted file mode 100644 index 8075ee2bd2e..00000000000 --- a/external/glob.js +++ /dev/null @@ -1,1333 +0,0 @@ -/* - * Globalization - * http://github.com/nje/jquery-glob - */ -(function() { - -var Globalization = {}, - localized = { en: {} }; -localized["default"] = localized.en; - -Globalization.extend = function( deep ) { - var target = arguments[ 1 ] || {}; - for ( var i = 2, l = arguments.length; i < l; i++ ) { - var source = arguments[ i ]; - if ( source ) { - for ( var field in source ) { - var sourceVal = source[ field ]; - if ( typeof sourceVal !== "undefined" ) { - if ( deep && (isObject( sourceVal ) || isArray( sourceVal )) ) { - var targetVal = target[ field ]; - // extend onto the existing value, or create a new one - targetVal = targetVal && (isObject( targetVal ) || isArray( targetVal )) - ? targetVal - : (isArray( sourceVal ) ? [] : {}); - target[ field ] = this.extend( true, targetVal, sourceVal ); - } - else { - target[ field ] = sourceVal; - } - } - } - } - } - return target; -} - -Globalization.findClosestCulture = function(name) { - var match; - if ( !name ) { - return this.culture || this.cultures["default"]; - } - if ( isString( name ) ) { - name = name.split( ',' ); - } - if ( isArray( name ) ) { - var lang, - cultures = this.cultures, - list = name, - i, l = list.length, - prioritized = []; - for ( i = 0; i < l; i++ ) { - name = trim( list[ i ] ); - var pri, parts = name.split( ';' ); - lang = trim( parts[ 0 ] ); - if ( parts.length === 1 ) { - pri = 1; - } - else { - name = trim( parts[ 1 ] ); - if ( name.indexOf("q=") === 0 ) { - name = name.substr( 2 ); - pri = parseFloat( name, 10 ); - pri = isNaN( pri ) ? 0 : pri; - } - else { - pri = 1; - } - } - prioritized.push( { lang: lang, pri: pri } ); - } - prioritized.sort(function(a, b) { - return a.pri < b.pri ? 1 : -1; - }); - for ( i = 0; i < l; i++ ) { - lang = prioritized[ i ].lang; - match = cultures[ lang ]; - // exact match? - if ( match ) { - return match; - } - } - for ( i = 0; i < l; i++ ) { - lang = prioritized[ i ].lang; - // for each entry try its neutral language - do { - var index = lang.lastIndexOf( "-" ); - if ( index === -1 ) { - break; - } - // strip off the last part. e.g. en-US => en - lang = lang.substr( 0, index ); - match = cultures[ lang ]; - if ( match ) { - return match; - } - } - while ( 1 ); - } - } - else if ( typeof name === 'object' ) { - return name; - } - return match || null; -} -Globalization.preferCulture = function(name) { - this.culture = this.findClosestCulture( name ) || this.cultures["default"]; -} -Globalization.localize = function(key, culture, value) { - if (typeof culture === 'string') { - culture = culture || "default"; - culture = this.cultures[ culture ] || { name: culture }; - } - var local = localized[ culture.name ]; - if ( arguments.length === 3 ) { - if ( !local) { - local = localized[ culture.name ] = {}; - } - local[ key ] = value; - } - else { - if ( local ) { - value = local[ key ]; - } - if ( typeof value === 'undefined' ) { - var language = localized[ culture.language ]; - if ( language ) { - value = language[ key ]; - } - if ( typeof value === 'undefined' ) { - value = localized["default"][ key ]; - } - } - } - return typeof value === "undefined" ? null : value; -} -Globalization.format = function(value, format, culture) { - culture = this.findClosestCulture( culture ); - if ( typeof value === "number" ) { - value = formatNumber( value, format, culture ); - } - else if ( value instanceof Date ) { - value = formatDate( value, format, culture ); - } - return value; -} -Globalization.parseInt = function(value, radix, culture) { - return Math.floor( this.parseFloat( value, radix, culture ) ); -} -Globalization.parseFloat = function(value, radix, culture) { - culture = this.findClosestCulture( culture ); - var ret = NaN, - nf = culture.numberFormat; - - // trim leading and trailing whitespace - value = trim( value ); - - // allow infinity or hexidecimal - if (regexInfinity.test(value)) { - ret = parseFloat(value, radix); - } - else if (!radix && regexHex.test(value)) { - ret = parseInt(value, 16); - } - else { - var signInfo = parseNegativePattern( value, nf, nf.pattern[0] ), - sign = signInfo[0], - num = signInfo[1]; - // determine sign and number - if ( sign === "" && nf.pattern[0] !== "-n" ) { - signInfo = parseNegativePattern( value, nf, "-n" ); - sign = signInfo[0]; - num = signInfo[1]; - } - sign = sign || "+"; - // determine exponent and number - var exponent, - intAndFraction, - exponentPos = num.indexOf( 'e' ); - if ( exponentPos < 0 ) exponentPos = num.indexOf( 'E' ); - if ( exponentPos < 0 ) { - intAndFraction = num; - exponent = null; - } - else { - intAndFraction = num.substr( 0, exponentPos ); - exponent = num.substr( exponentPos + 1 ); - } - // determine decimal position - var integer, - fraction, - decSep = nf['.'], - decimalPos = intAndFraction.indexOf( decSep ); - if ( decimalPos < 0 ) { - integer = intAndFraction; - fraction = null; - } - else { - integer = intAndFraction.substr( 0, decimalPos ); - fraction = intAndFraction.substr( decimalPos + decSep.length ); - } - // handle groups (e.g. 1,000,000) - var groupSep = nf[","]; - integer = integer.split(groupSep).join(''); - var altGroupSep = groupSep.replace(/\u00A0/g, " "); - if ( groupSep !== altGroupSep ) { - integer = integer.split(altGroupSep).join(''); - } - // build a natively parsable number string - var p = sign + integer; - if ( fraction !== null ) { - p += '.' + fraction; - } - if ( exponent !== null ) { - // exponent itself may have a number patternd - var expSignInfo = parseNegativePattern( exponent, nf, "-n" ); - p += 'e' + (expSignInfo[0] || "+") + expSignInfo[1]; - } - if ( regexParseFloat.test( p ) ) { - ret = parseFloat( p ); - } - } - return ret; -} -Globalization.parseDate = function(value, formats, culture) { - culture = this.findClosestCulture( culture ); - - var date, prop, patterns; - if ( formats ) { - if ( typeof formats === "string" ) { - formats = [ formats ]; - } - if ( formats.length ) { - for ( var i = 0, l = formats.length; i < l; i++ ) { - var format = formats[ i ]; - if ( format ) { - date = parseExact( value, format, culture ); - if ( date ) { - break; - } - } - } - } - } - else { - patterns = culture.calendar.patterns; - for ( prop in patterns ) { - date = parseExact( value, patterns[prop], culture ); - if ( date ) { - break; - } - } - } - return date || null; -} - -// 1. When defining a culture, all fields are required except the ones stated as optional. -// 2. You can use Globalization.extend to copy an existing culture and provide only the differing values, -// a good practice since most cultures do not differ too much from the 'default' culture. -// DO use the 'default' culture if you do this, as it is the only one that definitely -// exists. -// 3. Other plugins may add to the culture information provided by extending it. However, -// that plugin may extend it prior to the culture being defined, or after. Therefore, -// do not overwrite values that already exist when defining the baseline for a culture, -// by extending your culture object with the existing one. -// 4. Each culture should have a ".calendars" object with at least one calendar named "standard" -// which serves as the default calendar in use by that culture. -// 5. Each culture should have a ".calendar" object which is the current calendar being used, -// it may be dynamically changed at any time to one of the calendars in ".calendars". - -// To define a culture, use the following pattern, which handles defining the culture based -// on the 'default culture, extending it with the existing culture if it exists, and defining -// it if it does not exist. -// Globalization.cultures.foo = Globalization.extend(true, Globalization.extend(true, {}, Globalization.cultures['default'], fooCulture), Globalization.cultures.foo) - -var cultures = Globalization.cultures = Globalization.cultures || {}; -var en = cultures["default"] = cultures.en = Globalization.extend(true, { - // A unique name for the culture in the form - - name: "en", - // the name of the culture in the english language - englishName: "English", - // the name of the culture in its own language - nativeName: "English", - // whether the culture uses right-to-left text - isRTL: false, - // 'language' is used for so-called "specific" cultures. - // For example, the culture "es-CL" means "Spanish, in Chili". - // It represents the Spanish-speaking culture as it is in Chili, - // which might have different formatting rules or even translations - // than Spanish in Spain. A "neutral" culture is one that is not - // specific to a region. For example, the culture "es" is the generic - // Spanish culture, which may be a more generalized version of the language - // that may or may not be what a specific culture expects. - // For a specific culture like "es-CL", the 'language' field refers to the - // neutral, generic culture information for the language it is using. - // This is not always a simple matter of the string before the dash. - // For example, the "zh-Hans" culture is netural (Simplified Chinese). - // And the 'zh-SG' culture is Simplified Chinese in Singapore, whose lanugage - // field is "zh-CHS", not "zh". - // This field should be used to navigate from a specific culture to it's - // more general, neutral culture. If a culture is already as general as it - // can get, the language may refer to itself. - language: "en", - // numberFormat defines general number formatting rules, like the digits in - // each grouping, the group separator, and how negative numbers are displayed. - numberFormat: { - // [negativePattern] - // Note, numberFormat.pattern has no 'positivePattern' unlike percent and currency, - // but is still defined as an array for consistency with them. - // negativePattern: one of "(n)|-n|- n|n-|n -" - pattern: ["-n"], - // number of decimal places normally shown - decimals: 2, - // string that separates number groups, as in 1,000,000 - ',': ",", - // string that separates a number from the fractional portion, as in 1.99 - '.': ".", - // array of numbers indicating the size of each number group. - // TODO: more detailed description and example - groupSizes: [3], - // symbol used for positive numbers - '+': "+", - // symbol used for negative numbers - '-': "-", - percent: { - // [negativePattern, positivePattern] - // negativePattern: one of "-n %|-n%|-%n|%-n|%n-|n-%|n%-|-% n|n %-|% n-|% -n|n- %" - // positivePattern: one of "n %|n%|%n|% n" - pattern: ["-n %","n %"], - // number of decimal places normally shown - decimals: 2, - // array of numbers indicating the size of each number group. - // TODO: more detailed description and example - groupSizes: [3], - // string that separates number groups, as in 1,000,000 - ',': ",", - // string that separates a number from the fractional portion, as in 1.99 - '.': ".", - // symbol used to represent a percentage - symbol: "%" - }, - currency: { - // [negativePattern, positivePattern] - // negativePattern: one of "($n)|-$n|$-n|$n-|(n$)|-n$|n-$|n$-|-n $|-$ n|n $-|$ n-|$ -n|n- $|($ n)|(n $)" - // positivePattern: one of "$n|n$|$ n|n $" - pattern: ["($n)","$n"], - // number of decimal places normally shown - decimals: 2, - // array of numbers indicating the size of each number group. - // TODO: more detailed description and example - groupSizes: [3], - // string that separates number groups, as in 1,000,000 - ',': ",", - // string that separates a number from the fractional portion, as in 1.99 - '.': ".", - // symbol used to represent currency - symbol: "$" - } - }, - // calendars defines all the possible calendars used by this culture. - // There should be at least one defined with name 'standard', and is the default - // calendar used by the culture. - // A calendar contains information about how dates are formatted, information about - // the calendar's eras, a standard set of the date formats, - // translations for day and month names, and if the calendar is not based on the Gregorian - // calendar, conversion functions to and from the Gregorian calendar. - calendars: { - standard: { - // name that identifies the type of calendar this is - name: "Gregorian_USEnglish", - // separator of parts of a date (e.g. '/' in 11/05/1955) - '/': "/", - // separator of parts of a time (e.g. ':' in 05:44 PM) - ':': ":", - // the first day of the week (0 = Sunday, 1 = Monday, etc) - firstDay: 0, - days: { - // full day names - names: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], - // abbreviated day names - namesAbbr: ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], - // shortest day names - namesShort: ["Su","Mo","Tu","We","Th","Fr","Sa"] - }, - months: { - // full month names (13 months for lunar calendards -- 13th month should be "" if not lunar) - names: ["January","February","March","April","May","June","July","August","September","October","November","December",""], - // abbreviated month names - namesAbbr: ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""] - }, - // AM and PM designators in one of these forms: - // The usual view, and the upper and lower case versions - // [standard,lowercase,uppercase] - // The culture does not use AM or PM (likely all standard date formats use 24 hour time) - // null - AM: ["AM", "am", "AM"], - PM: ["PM", "pm", "PM"], - eras: [ - // eras in reverse chronological order. - // name: the name of the era in this culture (e.g. A.D., C.E.) - // start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era. - // offset: offset in years from gregorian calendar - { "name": "A.D.", "start": null, "offset": 0 } - ], - // when a two digit year is given, it will never be parsed as a four digit - // year greater than this year (in the appropriate era for the culture) - // Set it as a full year (e.g. 2029) or use an offset format starting from - // the current year: "+19" would correspond to 2029 if the current year 2010. - twoDigitYearMax: 2029, - // set of predefined date and time patterns used by the culture - // these represent the format someone in this culture would expect - // to see given the portions of the date that are shown. - patterns: { - // short date pattern - d: "M/d/yyyy", - // long date pattern - D: "dddd, MMMM dd, yyyy", - // short time pattern - t: "h:mm tt", - // long time pattern - T: "h:mm:ss tt", - // long date, short time pattern - f: "dddd, MMMM dd, yyyy h:mm tt", - // long date, long time pattern - F: "dddd, MMMM dd, yyyy h:mm:ss tt", - // month/day pattern - M: "MMMM dd", - // month/year pattern - Y: "yyyy MMMM", - // S is a sortable format that does not vary by culture - S: "yyyy\u0027-\u0027MM\u0027-\u0027dd\u0027T\u0027HH\u0027:\u0027mm\u0027:\u0027ss" - } - // optional fields for each calendar: - /* - monthsGenitive: - Same as months but used when the day preceeds the month. - Omit if the culture has no genitive distinction in month names. - For an explaination of genitive months, see http://blogs.msdn.com/michkap/archive/2004/12/25/332259.aspx - convert: - Allows for the support of non-gregorian based calendars. This convert object is used to - to convert a date to and from a gregorian calendar date to handle parsing and formatting. - The two functions: - fromGregorian(date) - Given the date as a parameter, return an array with parts [year, month, day] - corresponding to the non-gregorian based year, month, and day for the calendar. - toGregorian(year, month, day) - Given the non-gregorian year, month, and day, return a new Date() object - set to the corresponding date in the gregorian calendar. - */ - } - } -}, cultures.en); -en.calendar = en.calendar || en.calendars.standard; - -var regexTrim = /^\s+|\s+$/g, - regexInfinity = /^[+-]?infinity$/i, - regexHex = /^0x[a-f0-9]+$/i, - regexParseFloat = /^[+-]?\d*\.?\d*(e[+-]?\d+)?$/, - toString = Object.prototype.toString; - -function startsWith(value, pattern) { - return value.indexOf( pattern ) === 0; -} - -function endsWith(value, pattern) { - return value.substr( value.length - pattern.length ) === pattern; -} - -function trim(value) { - return (value+"").replace( regexTrim, "" ); -} - -function zeroPad(str, count, left) { - for (var l=str.length; l < count; l++) { - str = (left ? ('0' + str) : (str + '0')); - } - return str; -} - -function isArray(obj) { - return toString.call(obj) === "[object Array]"; -} - -function isString(obj) { - return toString.call(obj) === "[object String]"; -} - -function isObject(obj) { - return toString.call(obj) === "[object Object]"; -} - -function arrayIndexOf( array, item ) { - if ( array.indexOf ) { - return array.indexOf( item ); - } - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === item ) { - return i; - } - } - return -1; -} - -// *************************************** Numbers *************************************** - -function expandNumber(number, precision, formatInfo) { - var groupSizes = formatInfo.groupSizes, - curSize = groupSizes[ 0 ], - curGroupIndex = 1, - factor = Math.pow( 10, precision ), - rounded = Math.round( number * factor ) / factor; - if ( !isFinite(rounded) ) { - rounded = number; - } - number = rounded; - - var numberString = number+"", - right = "", - split = numberString.split(/e/i), - exponent = split.length > 1 ? parseInt( split[ 1 ], 10 ) : 0; - numberString = split[ 0 ]; - split = numberString.split( "." ); - numberString = split[ 0 ]; - right = split.length > 1 ? split[ 1 ] : ""; - - var l; - if ( exponent > 0 ) { - right = zeroPad( right, exponent, false ); - numberString += right.slice( 0, exponent ); - right = right.substr( exponent ); - } - else if ( exponent < 0 ) { - exponent = -exponent; - numberString = zeroPad( numberString, exponent + 1 ); - right = numberString.slice( -exponent, numberString.length ) + right; - numberString = numberString.slice( 0, -exponent ); - } - - if ( precision > 0 ) { - right = formatInfo['.'] + - ((right.length > precision) ? right.slice( 0, precision ) : zeroPad( right, precision )); - } - else { - right = ""; - } - - var stringIndex = numberString.length - 1, - sep = formatInfo[","], - ret = ""; - - while ( stringIndex >= 0 ) { - if ( curSize === 0 || curSize > stringIndex ) { - return numberString.slice( 0, stringIndex + 1 ) + ( ret.length ? ( sep + ret + right ) : right ); - } - ret = numberString.slice( stringIndex - curSize + 1, stringIndex + 1 ) + ( ret.length ? ( sep + ret ) : "" ); - - stringIndex -= curSize; - - if ( curGroupIndex < groupSizes.length ) { - curSize = groupSizes[ curGroupIndex ]; - curGroupIndex++; - } - } - return numberString.slice( 0, stringIndex + 1 ) + sep + ret + right; -} - - -function parseNegativePattern(value, nf, negativePattern) { - var neg = nf["-"], - pos = nf["+"], - ret; - switch (negativePattern) { - case "n -": - neg = ' ' + neg; - pos = ' ' + pos; - // fall through - case "n-": - if ( endsWith( value, neg ) ) { - ret = [ '-', value.substr( 0, value.length - neg.length ) ]; - } - else if ( endsWith( value, pos ) ) { - ret = [ '+', value.substr( 0, value.length - pos.length ) ]; - } - break; - case "- n": - neg += ' '; - pos += ' '; - // fall through - case "-n": - if ( startsWith( value, neg ) ) { - ret = [ '-', value.substr( neg.length ) ]; - } - else if ( startsWith(value, pos) ) { - ret = [ '+', value.substr( pos.length ) ]; - } - break; - case "(n)": - if ( startsWith( value, '(' ) && endsWith( value, ')' ) ) { - ret = [ '-', value.substr( 1, value.length - 2 ) ]; - } - break; - } - return ret || [ '', value ]; -} - -function formatNumber(value, format, culture) { - if ( !format || format === 'i' ) { - return culture.name.length ? value.toLocaleString() : value.toString(); - } - format = format || "D"; - - var nf = culture.numberFormat, - number = Math.abs(value), - precision = -1, - pattern; - if (format.length > 1) precision = parseInt( format.slice( 1 ), 10 ); - - var current = format.charAt( 0 ).toUpperCase(), - formatInfo; - - switch (current) { - case "D": - pattern = 'n'; - if (precision !== -1) { - number = zeroPad( ""+number, precision, true ); - } - if (value < 0) number = -number; - break; - case "N": - formatInfo = nf; - // fall through - case "C": - formatInfo = formatInfo || nf.currency; - // fall through - case "P": - formatInfo = formatInfo || nf.percent; - pattern = value < 0 ? formatInfo.pattern[0] : (formatInfo.pattern[1] || "n"); - if (precision === -1) precision = formatInfo.decimals; - number = expandNumber( number * (current === "P" ? 100 : 1), precision, formatInfo ); - break; - default: - throw "Bad number format specifier: " + current; - } - - var patternParts = /n|\$|-|%/g, - ret = ""; - for (;;) { - var index = patternParts.lastIndex, - ar = patternParts.exec(pattern); - - ret += pattern.slice( index, ar ? ar.index : pattern.length ); - - if (!ar) { - break; - } - - switch (ar[0]) { - case "n": - ret += number; - break; - case "$": - ret += nf.currency.symbol; - break; - case "-": - // don't make 0 negative - if ( /[1-9]/.test( number ) ) { - ret += nf["-"]; - } - break; - case "%": - ret += nf.percent.symbol; - break; - } - } - - return ret; -} - -// *************************************** Dates *************************************** - -function outOfRange(value, low, high) { - return value < low || value > high; -} - -function expandYear(cal, year) { - // expands 2-digit year into 4 digits. - var now = new Date(), - era = getEra(now); - if ( year < 100 ) { - var twoDigitYearMax = cal.twoDigitYearMax; - twoDigitYearMax = typeof twoDigitYearMax === 'string' ? new Date().getFullYear() % 100 + parseInt( twoDigitYearMax, 10 ) : twoDigitYearMax; - var curr = getEraYear( now, cal, era ); - year += curr - ( curr % 100 ); - if ( year > twoDigitYearMax ) { - year -= 100; - } - } - return year; -} - -function getEra(date, eras) { - if ( !eras ) return 0; - var start, ticks = date.getTime(); - for ( var i = 0, l = eras.length; i < l; i++ ) { - start = eras[ i ].start; - if ( start === null || ticks >= start ) { - return i; - } - } - return 0; -} - -function toUpper(value) { - // 'he-IL' has non-breaking space in weekday names. - return value.split( "\u00A0" ).join(' ').toUpperCase(); -} - -function toUpperArray(arr) { - var results = []; - for ( var i = 0, l = arr.length; i < l; i++ ) { - results[i] = toUpper(arr[i]); - } - return results; -} - -function getEraYear(date, cal, era, sortable) { - var year = date.getFullYear(); - if ( !sortable && cal.eras ) { - // convert normal gregorian year to era-shifted gregorian - // year by subtracting the era offset - year -= cal.eras[ era ].offset; - } - return year; -} - -function getDayIndex(cal, value, abbr) { - var ret, - days = cal.days, - upperDays = cal._upperDays; - if ( !upperDays ) { - cal._upperDays = upperDays = [ - toUpperArray( days.names ), - toUpperArray( days.namesAbbr ), - toUpperArray( days.namesShort ) - ]; - } - value = toUpper( value ); - if ( abbr ) { - ret = arrayIndexOf( upperDays[ 1 ], value ); - if ( ret === -1 ) { - ret = arrayIndexOf( upperDays[ 2 ], value ); - } - } - else { - ret = arrayIndexOf( upperDays[ 0 ], value ); - } - return ret; -} - -function getMonthIndex(cal, value, abbr) { - var months = cal.months, - monthsGen = cal.monthsGenitive || cal.months, - upperMonths = cal._upperMonths, - upperMonthsGen = cal._upperMonthsGen; - if ( !upperMonths ) { - cal._upperMonths = upperMonths = [ - toUpperArray( months.names ), - toUpperArray( months.namesAbbr ), - ]; - cal._upperMonthsGen = upperMonthsGen = [ - toUpperArray( monthsGen.names ), - toUpperArray( monthsGen.namesAbbr ) - ]; - } - value = toUpper( value ); - var i = arrayIndexOf( abbr ? upperMonths[ 1 ] : upperMonths[ 0 ], value ); - if ( i < 0 ) { - i = arrayIndexOf( abbr ? upperMonthsGen[ 1 ] : upperMonthsGen[ 0 ], value ); - } - return i; -} - -function appendPreOrPostMatch(preMatch, strings) { - // appends pre- and post- token match strings while removing escaped characters. - // Returns a single quote count which is used to determine if the token occurs - // in a string literal. - var quoteCount = 0, - escaped = false; - for ( var i = 0, il = preMatch.length; i < il; i++ ) { - var c = preMatch.charAt( i ); - switch ( c ) { - case '\'': - if ( escaped ) { - strings.push( "'" ); - } - else { - quoteCount++; - } - escaped = false; - break; - case '\\': - if ( escaped ) { - strings.push( "\\" ); - } - escaped = !escaped; - break; - default: - strings.push( c ); - escaped = false; - break; - } - } - return quoteCount; -} - -function expandFormat(cal, format) { - // expands unspecified or single character date formats into the full pattern. - format = format || "F"; - var pattern, - patterns = cal.patterns, - len = format.length; - if ( len === 1 ) { - pattern = patterns[ format ]; - if ( !pattern ) { - throw "Invalid date format string '" + format + "'."; - } - format = pattern; - } - else if ( len === 2 && format.charAt(0) === "%" ) { - // %X escape format -- intended as a custom format string that is only one character, not a built-in format. - format = format.charAt( 1 ); - } - return format; -} - -function getParseRegExp(cal, format) { - // converts a format string into a regular expression with groups that - // can be used to extract date fields from a date string. - // check for a cached parse regex. - var re = cal._parseRegExp; - if ( !re ) { - cal._parseRegExp = re = {}; - } - else { - var reFormat = re[ format ]; - if ( reFormat ) { - return reFormat; - } - } - - // expand single digit formats, then escape regular expression characters. - var expFormat = expandFormat( cal, format ).replace( /([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1" ), - regexp = ["^"], - groups = [], - index = 0, - quoteCount = 0, - tokenRegExp = getTokenRegExp(), - match; - - // iterate through each date token found. - while ( (match = tokenRegExp.exec( expFormat )) !== null ) { - var preMatch = expFormat.slice( index, match.index ); - index = tokenRegExp.lastIndex; - - // don't replace any matches that occur inside a string literal. - quoteCount += appendPreOrPostMatch( preMatch, regexp ); - if ( quoteCount % 2 ) { - regexp.push( match[ 0 ] ); - continue; - } - - // add a regex group for the token. - var m = match[ 0 ], - len = m.length, - add; - switch ( m ) { - case 'dddd': case 'ddd': - case 'MMMM': case 'MMM': - case 'gg': case 'g': - add = "(\\D+)"; - break; - case 'tt': case 't': - add = "(\\D*)"; - break; - case 'yyyy': - case 'fff': - case 'ff': - case 'f': - add = "(\\d{" + len + "})"; - break; - case 'dd': case 'd': - case 'MM': case 'M': - case 'yy': case 'y': - case 'HH': case 'H': - case 'hh': case 'h': - case 'mm': case 'm': - case 'ss': case 's': - add = "(\\d\\d?)"; - break; - case 'zzz': - add = "([+-]?\\d\\d?:\\d{2})"; - break; - case 'zz': case 'z': - add = "([+-]?\\d\\d?)"; - break; - case '/': - add = "(\\" + cal["/"] + ")"; - break; - default: - throw "Invalid date format pattern '" + m + "'."; - break; - } - if ( add ) { - regexp.push( add ); - } - groups.push( match[ 0 ] ); - } - appendPreOrPostMatch( expFormat.slice( index ), regexp ); - regexp.push( "$" ); - - // allow whitespace to differ when matching formats. - var regexpStr = regexp.join( '' ).replace( /\s+/g, "\\s+" ), - parseRegExp = {'regExp': regexpStr, 'groups': groups}; - - // cache the regex for this format. - return re[ format ] = parseRegExp; -} - -function getTokenRegExp() { - // regular expression for matching date and time tokens in format strings. - return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g; -} - -function parseExact(value, format, culture) { - // try to parse the date string by matching against the format string - // while using the specified culture for date field names. - value = trim( value ); - var cal = culture.calendar, - // convert date formats into regular expressions with groupings. - // use the regexp to determine the input format and extract the date fields. - parseInfo = getParseRegExp(cal, format), - match = new RegExp(parseInfo.regExp).exec(value); - if (match === null) { - return null; - } - // found a date format that matches the input. - var groups = parseInfo.groups, - era = null, year = null, month = null, date = null, weekDay = null, - hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null, - pmHour = false; - // iterate the format groups to extract and set the date fields. - for ( var j = 0, jl = groups.length; j < jl; j++ ) { - var matchGroup = match[ j + 1 ]; - if ( matchGroup ) { - var current = groups[ j ], - clength = current.length, - matchInt = parseInt( matchGroup, 10 ); - switch ( current ) { - case 'dd': case 'd': - // Day of month. - date = matchInt; - // check that date is generally in valid range, also checking overflow below. - if ( outOfRange( date, 1, 31 ) ) return null; - break; - case 'MMM': - case 'MMMM': - month = getMonthIndex( cal, matchGroup, clength === 3 ); - if ( outOfRange( month, 0, 11 ) ) return null; - break; - case 'M': case 'MM': - // Month. - month = matchInt - 1; - if ( outOfRange( month, 0, 11 ) ) return null; - break; - case 'y': case 'yy': - case 'yyyy': - year = clength < 4 ? expandYear( cal, matchInt ) : matchInt; - if ( outOfRange( year, 0, 9999 ) ) return null; - break; - case 'h': case 'hh': - // Hours (12-hour clock). - hour = matchInt; - if ( hour === 12 ) hour = 0; - if ( outOfRange( hour, 0, 11 ) ) return null; - break; - case 'H': case 'HH': - // Hours (24-hour clock). - hour = matchInt; - if ( outOfRange( hour, 0, 23 ) ) return null; - break; - case 'm': case 'mm': - // Minutes. - min = matchInt; - if ( outOfRange( min, 0, 59 ) ) return null; - break; - case 's': case 'ss': - // Seconds. - sec = matchInt; - if ( outOfRange( sec, 0, 59 ) ) return null; - break; - case 'tt': case 't': - // AM/PM designator. - // see if it is standard, upper, or lower case PM. If not, ensure it is at least one of - // the AM tokens. If not, fail the parse for this format. - pmHour = cal.PM && ( matchGroup === cal.PM[0] || matchGroup === cal.PM[1] || matchGroup === cal.PM[2] ); - if ( !pmHour && ( !cal.AM || (matchGroup !== cal.AM[0] && matchGroup !== cal.AM[1] && matchGroup !== cal.AM[2]) ) ) return null; - break; - case 'f': - // Deciseconds. - case 'ff': - // Centiseconds. - case 'fff': - // Milliseconds. - msec = matchInt * Math.pow( 10, 3-clength ); - if ( outOfRange( msec, 0, 999 ) ) return null; - break; - case 'ddd': - // Day of week. - case 'dddd': - // Day of week. - weekDay = getDayIndex( cal, matchGroup, clength === 3 ); - if ( outOfRange( weekDay, 0, 6 ) ) return null; - break; - case 'zzz': - // Time zone offset in +/- hours:min. - var offsets = matchGroup.split( /:/ ); - if ( offsets.length !== 2 ) return null; - hourOffset = parseInt( offsets[ 0 ], 10 ); - if ( outOfRange( hourOffset, -12, 13 ) ) return null; - var minOffset = parseInt( offsets[ 1 ], 10 ); - if ( outOfRange( minOffset, 0, 59 ) ) return null; - tzMinOffset = (hourOffset * 60) + (startsWith( matchGroup, '-' ) ? -minOffset : minOffset); - break; - case 'z': case 'zz': - // Time zone offset in +/- hours. - hourOffset = matchInt; - if ( outOfRange( hourOffset, -12, 13 ) ) return null; - tzMinOffset = hourOffset * 60; - break; - case 'g': case 'gg': - var eraName = matchGroup; - if ( !eraName || !cal.eras ) return null; - eraName = trim( eraName.toLowerCase() ); - for ( var i = 0, l = cal.eras.length; i < l; i++ ) { - if ( eraName === cal.eras[ i ].name.toLowerCase() ) { - era = i; - break; - } - } - // could not find an era with that name - if ( era === null ) return null; - break; - } - } - } - var result = new Date(), defaultYear, convert = cal.convert; - defaultYear = convert ? convert.fromGregorian( result )[ 0 ] : result.getFullYear(); - if ( year === null ) { - year = defaultYear; - } - else if ( cal.eras ) { - // year must be shifted to normal gregorian year - // but not if year was not specified, its already normal gregorian - // per the main if clause above. - year += cal.eras[ (era || 0) ].offset; - } - // set default day and month to 1 and January, so if unspecified, these are the defaults - // instead of the current day/month. - if ( month === null ) { - month = 0; - } - if ( date === null ) { - date = 1; - } - // now have year, month, and date, but in the culture's calendar. - // convert to gregorian if necessary - if ( convert ) { - result = convert.toGregorian( year, month, date ); - // conversion failed, must be an invalid match - if ( result === null ) return null; - } - else { - // have to set year, month and date together to avoid overflow based on current date. - result.setFullYear( year, month, date ); - // check to see if date overflowed for specified month (only checked 1-31 above). - if ( result.getDate() !== date ) return null; - // invalid day of week. - if ( weekDay !== null && result.getDay() !== weekDay ) { - return null; - } - } - // if pm designator token was found make sure the hours fit the 24-hour clock. - if ( pmHour && hour < 12 ) { - hour += 12; - } - result.setHours( hour, min, sec, msec ); - if ( tzMinOffset !== null ) { - // adjust timezone to utc before applying local offset. - var adjustedMin = result.getMinutes() - ( tzMinOffset + result.getTimezoneOffset() ); - // Safari limits hours and minutes to the range of -127 to 127. We need to use setHours - // to ensure both these fields will not exceed this range. adjustedMin will range - // somewhere between -1440 and 1500, so we only need to split this into hours. - result.setHours( result.getHours() + parseInt( adjustedMin / 60, 10 ), adjustedMin % 60 ); - } - return result; -} - -function formatDate(value, format, culture) { - var cal = culture.calendar, - convert = cal.convert; - if ( !format || !format.length || format === 'i' ) { - var ret; - if ( culture && culture.name.length ) { - if ( convert ) { - // non-gregorian calendar, so we cannot use built-in toLocaleString() - ret = formatDate( value, cal.patterns.F, culture ); - } - else { - var eraDate = new Date( value.getTime() ), - era = getEra( value, cal.eras ); - eraDate.setFullYear( getEraYear( value, cal, era ) ); - ret = eraDate.toLocaleString(); - } - } - else { - ret = value.toString(); - } - return ret; - } - - var eras = cal.eras, - sortable = format === "s"; - format = expandFormat( cal, format ); - - // Start with an empty string - ret = []; - var hour, - zeros = ['0','00','000'], - foundDay, - checkedDay, - dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g, - quoteCount = 0, - tokenRegExp = getTokenRegExp(), - converted; - - function padZeros(num, c) { - var r, s = num+''; - if ( c > 1 && s.length < c ) { - r = ( zeros[ c - 2 ] + s); - return r.substr( r.length - c, c ); - } - else { - r = s; - } - return r; - } - - function hasDay() { - if ( foundDay || checkedDay ) { - return foundDay; - } - foundDay = dayPartRegExp.test( format ); - checkedDay = true; - return foundDay; - } - - function getPart( date, part ) { - if ( converted ) { - return converted[ part ]; - } - switch ( part ) { - case 0: return date.getFullYear(); - case 1: return date.getMonth(); - case 2: return date.getDate(); - } - } - - if ( !sortable && convert ) { - converted = convert.fromGregorian( value ); - } - - for (;;) { - // Save the current index - var index = tokenRegExp.lastIndex, - // Look for the next pattern - ar = tokenRegExp.exec( format ); - - // Append the text before the pattern (or the end of the string if not found) - var preMatch = format.slice( index, ar ? ar.index : format.length ); - quoteCount += appendPreOrPostMatch( preMatch, ret ); - - if ( !ar ) { - break; - } - - // do not replace any matches that occur inside a string literal. - if ( quoteCount % 2 ) { - ret.push( ar[ 0 ] ); - continue; - } - - var current = ar[ 0 ], - clength = current.length; - - switch ( current ) { - case "ddd": - //Day of the week, as a three-letter abbreviation - case "dddd": - // Day of the week, using the full name - names = (clength === 3) ? cal.days.namesAbbr : cal.days.names; - ret.push( names[ value.getDay() ] ); - break; - case "d": - // Day of month, without leading zero for single-digit days - case "dd": - // Day of month, with leading zero for single-digit days - foundDay = true; - ret.push( padZeros( getPart( value, 2 ), clength ) ); - break; - case "MMM": - // Month, as a three-letter abbreviation - case "MMMM": - // Month, using the full name - var part = getPart( value, 1 ); - ret.push( (cal.monthsGenitive && hasDay()) - ? cal.monthsGenitive[ clength === 3 ? "namesAbbr" : "names" ][ part ] - : cal.months[ clength === 3 ? "namesAbbr" : "names" ][ part ] ); - break; - case "M": - // Month, as digits, with no leading zero for single-digit months - case "MM": - // Month, as digits, with leading zero for single-digit months - ret.push( padZeros( getPart( value, 1 ) + 1, clength ) ); - break; - case "y": - // Year, as two digits, but with no leading zero for years less than 10 - case "yy": - // Year, as two digits, with leading zero for years less than 10 - case "yyyy": - // Year represented by four full digits - part = converted ? converted[ 0 ] : getEraYear( value, cal, getEra( value, eras ), sortable ); - if ( clength < 4 ) { - part = part % 100; - } - ret.push( padZeros( part, clength ) ); - break; - case "h": - // Hours with no leading zero for single-digit hours, using 12-hour clock - case "hh": - // Hours with leading zero for single-digit hours, using 12-hour clock - hour = value.getHours() % 12; - if ( hour === 0 ) hour = 12; - ret.push( padZeros( hour, clength ) ); - break; - case "H": - // Hours with no leading zero for single-digit hours, using 24-hour clock - case "HH": - // Hours with leading zero for single-digit hours, using 24-hour clock - ret.push( padZeros( value.getHours(), clength ) ); - break; - case "m": - // Minutes with no leading zero for single-digit minutes - case "mm": - // Minutes with leading zero for single-digit minutes - ret.push( padZeros( value.getMinutes(), clength ) ); - break; - case "s": - // Seconds with no leading zero for single-digit seconds - case "ss": - // Seconds with leading zero for single-digit seconds - ret.push( padZeros(value .getSeconds(), clength ) ); - break; - case "t": - // One character am/pm indicator ("a" or "p") - case "tt": - // Multicharacter am/pm indicator - part = value.getHours() < 12 ? (cal.AM ? cal.AM[0] : " ") : (cal.PM ? cal.PM[0] : " "); - ret.push( clength === 1 ? part.charAt( 0 ) : part ); - break; - case "f": - // Deciseconds - case "ff": - // Centiseconds - case "fff": - // Milliseconds - ret.push( padZeros( value.getMilliseconds(), 3 ).substr( 0, clength ) ); - break; - case "z": - // Time zone offset, no leading zero - case "zz": - // Time zone offset with leading zero - hour = value.getTimezoneOffset() / 60; - ret.push( (hour <= 0 ? '+' : '-') + padZeros( Math.floor( Math.abs( hour ) ), clength ) ); - break; - case "zzz": - // Time zone offset with leading zero - hour = value.getTimezoneOffset() / 60; - ret.push( (hour <= 0 ? '+' : '-') + padZeros( Math.floor( Math.abs( hour ) ), 2 ) + - // Hard coded ":" separator, rather than using cal.TimeSeparator - // Repeated here for consistency, plus ":" was already assumed in date parsing. - ":" + padZeros( Math.abs( value.getTimezoneOffset() % 60 ), 2 ) ); - break; - case "g": - case "gg": - if ( cal.eras ) { - ret.push( cal.eras[ getEra(value, eras) ].name ); - } - break; - case "/": - ret.push( cal["/"] ); - break; - default: - throw "Invalid date format pattern '" + current + "'."; - break; - } - } - return ret.join( '' ); -} - -// EXPORTS - -window.Globalization = Globalization; - -//jQuery.findClosestCulture = Globalization.findClosestCulture; -//jQuery.culture = Globalization.culture; -//jQuery.cultures = Globalization.cultures -//jQuery.preferCulture = Globalization.preferCulture -//jQuery.localize = Globalization.localize -//jQuery.format = Globalization.format -//jQuery.parseInt = Globalization.parseInt -//jQuery.parseFloat = Globalization.parseFloat -//jQuery.parseDate = Globalization.parseDate - -})(); diff --git a/external/jquery.mousewheel-3.0.4.js b/external/jquery.mousewheel-3.0.4.js deleted file mode 100644 index dbf8f4b0fac..00000000000 --- a/external/jquery.mousewheel-3.0.4.js +++ /dev/null @@ -1,78 +0,0 @@ -/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) - * Licensed under the MIT License (LICENSE.txt). - * - * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. - * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. - * Thanks to: Seamus Leahy for adding deltaX and deltaY - * - * Version: 3.0.4 - * - * Requires: 1.2.2+ - */ - -(function($) { - -var types = ['DOMMouseScroll', 'mousewheel']; - -$.event.special.mousewheel = { - setup: function() { - if ( this.addEventListener ) { - for ( var i=types.length; i; ) { - this.addEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = handler; - } - }, - - teardown: function() { - if ( this.removeEventListener ) { - for ( var i=types.length; i; ) { - this.removeEventListener( types[--i], handler, false ); - } - } else { - this.onmousewheel = null; - } - } -}; - -$.fn.extend({ - mousewheel: function(fn) { - return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel"); - }, - - unmousewheel: function(fn) { - return this.unbind("mousewheel", fn); - } -}); - - -function handler(event) { - var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0; - event = $.event.fix(orgEvent); - event.type = "mousewheel"; - - // Old school scrollwheel delta - if ( event.wheelDelta ) { delta = event.wheelDelta/120; } - if ( event.detail ) { delta = -event.detail/3; } - - // New school multidimensional scroll (touchpads) deltas - deltaY = delta; - - // Gecko - if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { - deltaY = 0; - deltaX = -1*delta; - } - - // Webkit - if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; } - if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; } - - // Add event and delta to the front of the arguments - args.unshift(event, delta, deltaX, deltaY); - - return $.event.handle.apply(this, args); -} - -})(jQuery); \ No newline at end of file diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index 81d7f62bf83..a88b6cbe4ea 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -1,7 +1,7 @@ /* * jquery.simulate - simulate browser mouse and keyboard events * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/tests/static/index.html b/tests/static/index.html index 3145ad2196c..80048bf422b 100644 --- a/tests/static/index.html +++ b/tests/static/index.html @@ -32,8 +32,6 @@

Widgets

  • Button
  • Datepicker
  • Dialog
  • -
  • Menu
  • -
  • Menu with icons
  • Progressbar
  • Slider
  • Tabs
  • diff --git a/tests/unit/accordion/accordion_defaults.js b/tests/unit/accordion/accordion_defaults.js index bf5725f3002..e472734bc61 100644 --- a/tests/unit/accordion/accordion_defaults.js +++ b/tests/unit/accordion/accordion_defaults.js @@ -12,7 +12,6 @@ var accordion_defaults = { event: "click", fillSpace: false, header: "> li > :first-child,> :not(li):even", - heightStyle: null, icons: { "header": "ui-icon-triangle-1-e", "headerSelected": "ui-icon-triangle-1-s" }, navigation: false, navigationFilter: function() {} diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js index 26bcb19e5d4..291deb2147c 100644 --- a/tests/unit/accordion/accordion_options.js +++ b/tests/unit/accordion/accordion_options.js @@ -69,10 +69,6 @@ test("{ autoHeight: true }, default", function() { equalHeights($('#navigation').accordion({ autoHeight: true }), 95, 130); }); -test("{ heightStyle: 'auto' }, default", function() { - equalHeights($('#navigation').accordion({ heightStyle: 'auto' }), 95, 130); -}); - test("{ autoHeight: false }", function() { var accordion = $('#navigation').accordion({ autoHeight: false }); var sizes = []; @@ -84,16 +80,6 @@ test("{ autoHeight: false }", function() { ok( sizes[2] >= 42 && sizes[2] <= 54, "was " + sizes[2] ); }); -test("{ heightStyle: 'content' }", function() { - var accordion = $('#navigation').accordion({ heightStyle: 'content' }); - var sizes = []; - accordion.find(".ui-accordion-content").each(function() { - sizes.push($(this).height()); - }); - ok( sizes[0] >= 70 && sizes[0] <= 90, "was " + sizes[0] ); - ok( sizes[1] >= 98 && sizes[1] <= 126, "was " + sizes[1] ); - ok( sizes[2] >= 42 && sizes[2] <= 54, "was " + sizes[2] ); -}); test("{ collapsible: false }, default", function() { var ac = $("#list1").accordion(); ac.accordion("activate", false); @@ -116,30 +102,6 @@ test("{ fillSpace: true }", function() { equalHeights($('#navigation').accordion({ fillSpace: true }), 446, 458); }); -test("{ heightStyle: 'fill' }", function() { - $("#navigationWrapper").height(500); - equalHeights($('#navigation').accordion({ heightStyle: 'fill' }), 446, 458); -}); - -test("{ fillSpace: true } with sibling", function() { - $("#navigationWrapper").height(500); - var sibling = $("

    Lorem Ipsum

    "); - $("#navigationWrapper").prepend( sibling.height(100) ); - //sibling.outerHeight(true) == 126 - equalHeights($('#navigation').accordion({ fillSpace: true}), 320, 332); -}); - -test("{ fillSpace: true } with multiple siblings", function() { - $("#navigationWrapper").height(500); - var sibling = $("

    Lorem Ipsum

    "); - $("#navigationWrapper") - .prepend( sibling.clone().height(100) ) - .prepend( sibling.clone().height(100).css( "position", "absolute" ) ) - .prepend( sibling.clone().height(50) ); - //sibling.outerHeight(true) == 126 - equalHeights($('#navigation').accordion({ fillSpace: true}), 244, 256); -}); - test("{ header: '> li > :first-child,> :not(li):even' }, default", function() { state($("#list1").accordion(), 1, 0, 0); state($("#navigation").accordion(), 1, 0, 0); diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js index 9867022f710..2730ec86124 100644 --- a/tests/unit/datepicker/datepicker_core.js +++ b/tests/unit/datepicker/datepicker_core.js @@ -47,6 +47,11 @@ module("datepicker: core", { } }); +test( "widget method - empty collection", function() { + $( "#nonExist" ).datepicker(); // should create nothing + ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" ); +}); + test("widget method", function() { var actual = $("#inp").datepicker().datepicker("widget")[0]; same($("body > #ui-datepicker-div:last-child")[0], actual); diff --git a/tests/unit/datepicker/datepicker_options.js b/tests/unit/datepicker/datepicker_options.js index af561a78389..33b07d6949d 100644 --- a/tests/unit/datepicker/datepicker_options.js +++ b/tests/unit/datepicker/datepicker_options.js @@ -796,16 +796,21 @@ test('parseDate', function() { equalsDate($.datepicker.parseDate('\'day\' d \'of\' MM (\'\'DD\'\'), yy', 'day 3 of February (\'Saturday\'), 2001'), new Date(2001, 2 - 1, 3), 'Parse date \'day\' d \'of\' MM (\'\'DD\'\'), yy'); - equalsDate($.datepicker.parseDate('ymmdd', '010203'), - new Date(2001, 2 - 1, 3), 'Parse date ymmdd - default cutoff'); - equalsDate($.datepicker.parseDate('y-m-d', '01-02-03'), - new Date(2001, 2 - 1, 3), 'Parse date y-m-d - default cutoff'); - equalsDate($.datepicker.parseDate('y-m-d', '51-02-03'), - new Date(1951, 2 - 1, 3), 'Parse date y-m-d - default cutoff'); - equalsDate($.datepicker.parseDate('y-m-d', '51-02-03', {shortYearCutoff: 80}), - new Date(2051, 2 - 1, 3), 'Parse date y-m-d - cutoff 80'); - equalsDate($.datepicker.parseDate('y-m-d', '51-02-03', {shortYearCutoff: '+60'}), - new Date(2051, 2 - 1, 3), 'Parse date y-m-d - cutoff +60'); + var currentYear = new Date().getFullYear(); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000) + '-02-03'), + new Date(currentYear, 2 - 1, 3), 'Parse date y-m-d - default cutuff'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 10) + '-02-03'), + new Date(currentYear+10, 2 - 1, 3), 'Parse date y-m-d - default cutuff'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 11) + '-02-03'), + new Date(currentYear-89, 2 - 1, 3), 'Parse date y-m-d - default cutuff'); + equalsDate($.datepicker.parseDate('y-m-d', '80-02-03', {shortYearCutoff: 80}), + new Date(2080, 2 - 1, 3), 'Parse date y-m-d - cutoff 80'); + equalsDate($.datepicker.parseDate('y-m-d', '81-02-03', {shortYearCutoff: 80}), + new Date(1981, 2 - 1, 3), 'Parse date y-m-d - cutoff 80'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 60) + '-02-03', {shortYearCutoff: '+60'}), + new Date(currentYear + 60, 2 - 1, 3), 'Parse date y-m-d - cutoff +60'); + equalsDate($.datepicker.parseDate('y-m-d', (currentYear - 2000 + 61) + '-02-03', {shortYearCutoff: '+60'}), + new Date(currentYear - 39, 2 - 1, 3), 'Parse date y-m-d - cutoff +60'); var gmtDate = new Date(2001, 2 - 1, 3); gmtDate.setMinutes(gmtDate.getMinutes() - gmtDate.getTimezoneOffset()); equalsDate($.datepicker.parseDate('@', '981158400000'), gmtDate, 'Parse date @'); diff --git a/tests/unit/index.html b/tests/unit/index.html index f45499c2b86..33de9e7651c 100644 --- a/tests/unit/index.html +++ b/tests/unit/index.html @@ -19,6 +19,27 @@ } + + + + + + + + + + + + + + + + + + + + + @@ -49,7 +70,6 @@

    Widgets

  • Progressbar
  • Slider
  • Tabs
  • -
  • Tooltip
  • Utilities

    diff --git a/tests/unit/menu/menu.html b/tests/unit/menu/menu.html deleted file mode 100644 index 85abac511f3..00000000000 --- a/tests/unit/menu/menu.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - jQuery UI Menu Test Suite - - - - - - - - - - - - - - - - - - - - - - - - - - -

    jQuery UI Menu Test Suite

    -

    -

    -
      -
    - - -
    - - -
    - -
    - - - diff --git a/tests/unit/menu/menu_core.js b/tests/unit/menu/menu_core.js deleted file mode 100644 index a1cf11b7f72..00000000000 --- a/tests/unit/menu/menu_core.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * menu_core.js - */ - - -(function($) { - -module("menu: core"); - -test("accessibility", function () { - expect(3); - var ac = $('#menu1').menu(); - var item0 = $("li:eq(0) a"); - - ok( ac.hasClass("ui-menu ui-widget ui-widget-content ui-corner-all"), "menu class"); - equals( ac.attr("role"), "listbox", "main role"); - equals( ac.attr("aria-activedescendant"), "ui-active-menuitem", "aria attribute"); -}); - -test("items class and role", function () { - var ac = $('#menu1').menu(); - expect(1 + 4 * $("li",ac).length); - ok( ($("li",ac).length > 0 ), "number of menu items"); - $("li",ac).each(function(item) { - ok( $(this).hasClass("ui-menu-item"), "menu item ("+ item + ") class for item"); - equals( $(this).attr("role"), "menuitem", "menu item ("+ item + ") role"); - ok( $("a",this).hasClass("ui-corner-all"), "a element class for menu item ("+ item + ") "); - equals( $("a",this).attr("tabindex"), "-1", "a element tabindex for menu item ("+ item + ") "); - }); -}); - -})(jQuery); diff --git a/tests/unit/menu/menu_defaults.js b/tests/unit/menu/menu_defaults.js deleted file mode 100644 index c3f741d2a8f..00000000000 --- a/tests/unit/menu/menu_defaults.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * menu_defaults.js - */ - -var menu_defaults = { - disabled: false, - navigationFilter: function() {} - -}; - -commonWidgetTests('menu', { defaults: menu_defaults }); diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js deleted file mode 100644 index a03bec3f640..00000000000 --- a/tests/unit/menu/menu_events.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * menu_events.js - */ -(function($) { - -module("menu: events"); - -test("handle click on menu", function() { - expect(1); - var ac = $('#menu1').menu({ - select: function(event, ui) { - log(); - } - }); - log("click",true); - clickMenu($('#menu1'),"1"); - log("afterclick"); - clickMenu( ac,"2"); - clickMenu($('#menu1'),"3"); - clickMenu( ac,"1"); - equals( $("#log").html(), "1,3,2,afterclick,1,click,", "Click order not valid."); -}); - -})(jQuery); diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js deleted file mode 100644 index b6ebaf21532..00000000000 --- a/tests/unit/menu/menu_methods.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * menu_methods.js - */ -(function($) { - -module("menu: methods"); - -test("destroy", function() { - var beforeHtml = $("#menu1").find("div").css("font-style", "normal").end().parent().html(); - var afterHtml = $("#menu1").menu().menu("destroy").parent().html(); - // Opera 9 outputs role="" instead of removing the attribute like everyone else - if ($.browser.opera) { - afterHtml = afterHtml.replace(/ role=""/g, ""); - } - equal( afterHtml, beforeHtml ); -}); - - -})(jQuery); diff --git a/tests/unit/menu/menu_options.js b/tests/unit/menu/menu_options.js deleted file mode 100644 index 03822fd74d1..00000000000 --- a/tests/unit/menu/menu_options.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * menu_options.js - */ -(function($) { - -module("menu: options"); - - - -})(jQuery); diff --git a/tests/unit/menu/menu_tickets.js b/tests/unit/menu/menu_tickets.js deleted file mode 100644 index 760afd368e9..00000000000 --- a/tests/unit/menu/menu_tickets.js +++ /dev/null @@ -1,8 +0,0 @@ -/* - * menu_tickets.js - */ -(function($) { - -module("menu: tickets"); - -})(jQuery); diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html deleted file mode 100644 index 2729fce8dca..00000000000 --- a/tests/unit/spinner/spinner.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - jQuery UI Spinner Test Suite - - - - - - - - - - - - - - - - - - - - - - - - - -

    jQuery UI Slider Test Suite

    -

    -

    -
      -
    - -
    - - -
    - - - diff --git a/tests/unit/spinner/spinner_core.js b/tests/unit/spinner/spinner_core.js deleted file mode 100644 index 88603708f4d..00000000000 --- a/tests/unit/spinner/spinner_core.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * spinner_core.js - */ - -var simulateKeyDownUp = function(el, kCode, shift) { - el.simulate("keydown",{keyCode:kCode, shiftKey: shift || false }) - .simulate("keyup",{keyCode:kCode, shiftKey: shift || false }); -}; - -(function($) { - -// Spinner Tests -module("spinner: core"); - -test("destroy", function() { - // cheat a bit to get IE6 to pass - $("#spin").val(0); - var beforeHtml = $("#spin").parent().html(); - var afterHtml = $("#spin").spinner().spinner("destroy").parent().html(); - equal( afterHtml, beforeHtml, "before/after html should be the same" ); -}); - -test("keydown UP on input, increases value not greater than max", function() { - var el = $("#spin").spinner({ - max:100, - value:50, - step:10 - }); - - simulateKeyDownUp(el, $.ui.keyCode.UP); - equals(el.val(), 60); - - for (i = 0; i<11; i++) { - simulateKeyDownUp(el, $.ui.keyCode.UP); - } - equals(el.val(), 100); - - el.spinner("value", 50); - simulateKeyDownUp(el, $.ui.keyCode.UP); - equals(el.val(), 60); -}); - -test("keydown DOWN on input, decreases value not less than min", function() { - var el = $("#spin").spinner({ - min:-100, - value:50, - step:10 - }); - - simulateKeyDownUp(el, $.ui.keyCode.DOWN); - equals(el.val(), 40); - - for (i = 0; i<21; i++) { - simulateKeyDownUp(el, $.ui.keyCode.DOWN); - } - equals(el.val(), -100); - - el.spinner("value", 50); - simulateKeyDownUp(el, $.ui.keyCode.DOWN); - equals(el.val(), 40); -}); - -test("keydown PGUP on input, increases value not greater than max", function() { - var el = $("#spin").spinner({ - max: 500, - value: 0, - step: 10 - }); - - simulateKeyDownUp(el, $.ui.keyCode.PAGE_UP); - equal(el.val(), 100); - - for (i = 0; i<5; i++) { - simulateKeyDownUp(el, $.ui.keyCode.PAGE_UP); - } - equal(el.val(), 500); - - el.spinner("value", 0); - simulateKeyDownUp(el, $.ui.keyCode.PAGE_UP); - equals(el.val(), 100); -}); - -test("keydown PGDN on input, decreases value not less than min", function() { - var el = $("#spin").spinner({ - min:-500, - value:0, - step:10 - }); - - simulateKeyDownUp(el, $.ui.keyCode.PAGE_DOWN); - equals(el.val(), -100); - - for (i = 0; i<5; i++) { - simulateKeyDownUp(el, $.ui.keyCode.PAGE_DOWN); - } - equals(el.val(), -500); - - el.spinner("value", 0); - simulateKeyDownUp(el, $.ui.keyCode.PAGE_DOWN); - equals(el.val(), -100); -}); - -test("mouse click on buttons", function() { - var el = $("#spin").spinner(), - val = 0; - - $(".ui-spinner-up").trigger("mousedown").trigger("mouseup"); - equals(el.val(), ++val, "mouse click to up"); - - $(".ui-spinner-down").trigger("mousedown").trigger("mouseup"); - equals(el.val(), --val, "mouse click to down"); - - el.spinner("value", 50); - $(".ui-spinner-up").trigger("mousedown").trigger("mouseup"); - equals(el.val(), 51); - - el.spinner("value", 50); - $(".ui-spinner-down").trigger("mousedown").trigger("mouseup"); - equals(el.val(), 49); -}); - -test("mouse wheel on input", function() { - expect(3); - - var el = $("#spin").spinner(); - el.trigger("mousewheel", 1); - equal(el.val(), 1); - - // mousewheel handler uses a timeout, need to accomodate that - stop(); - setTimeout(function() { - el.trigger("mousewheel", -1); - equal(el.val(), 0); - - setTimeout(function() { - el.trigger("mousewheel", -1); - equal(el.val(), -1); - start(); - }, 100); - }, 100); - -}); - -test("reading HTML5 attributes", function() { - var el = $('').spinner(); - equals(el.spinner('option', 'value'), 5, 'value'); - equals(el.spinner('option', 'max'), 100, 'max'); - equals(el.spinner('option', 'min'), -100, 'min'); - equals(el.spinner('option', 'step'), 2, 'step'); -}); - -test("ARIA attributes", function() { - var el = $('#spin').spinner({ min: -5, max: 5, value: 2 }), - wrapper = el.spinner("widget"); - - equals(wrapper.attr('role'), 'spinbutton', 'role'); - equals(wrapper.attr('aria-valuemin'), -5, 'aria-valuemin'); - equals(wrapper.attr('aria-valuemax'), 5, 'aria-valuemax'); - equals(wrapper.attr('aria-valuenow'), 2, 'aria-valuenow'); - - el.spinner('stepUp'); - - equals(wrapper.attr('aria-valuenow'), 3, 'stepUp 1 step changes aria-valuenow'); - - el.spinner('option', { min: -10, max: 10 }); - - equals(wrapper.attr('aria-valuemin'), -10, 'min option changed aria-valuemin changes'); - equals(wrapper.attr('aria-valuemax'), 10, 'max option changed aria-valuemax changes'); -}); - -})(jQuery); diff --git a/tests/unit/spinner/spinner_defaults.js b/tests/unit/spinner/spinner_defaults.js deleted file mode 100644 index 2f5d77585e1..00000000000 --- a/tests/unit/spinner/spinner_defaults.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * spinner_defaults.js - */ - -var spinner_defaults = { - disabled: false, - incremental: true, - max: null, - min: null, - numberformat: null, - step: null, - value: null -}; - -commonWidgetTests('spinner', { defaults: spinner_defaults }); diff --git a/tests/unit/spinner/spinner_events.js b/tests/unit/spinner/spinner_events.js deleted file mode 100644 index c0771ca2f8f..00000000000 --- a/tests/unit/spinner/spinner_events.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * spinner_events.js - */ -(function($) { - -module("spinner: events"); - -test("start", function() { - var start = 0; - - var el = $("#spin").spinner({ - start: function(){ - start++; - } - }); - - simulateKeyDownUp(el, $.ui.keyCode.UP); - - equals(start, 1, "Start triggered"); -}); - -test("spin", function() { - var spin = 0; - - var el = $("#spin").spinner({ - spin: function(){ - spin++; - } - }); - - simulateKeyDownUp(el, $.ui.keyCode.UP); - - equals(spin, 1, "Spin triggered"); -}); - -test("stop", function() { - var stop = 0; - - var el = $("#spin").spinner({ - stop: function(){ - stop++; - } - }); - - simulateKeyDownUp(el, $.ui.keyCode.DOWN); - - equals(stop, 1, "Stop triggered"); -}); - -test("change", function() { - var change = 0; - - var el = $("#spin").spinner({ - change: function(){ - change++; - } - }); - - simulateKeyDownUp(el, $.ui.keyCode.UP); - - equals(change, 1, "Change triggered"); -}); - -})(jQuery); diff --git a/tests/unit/spinner/spinner_methods.js b/tests/unit/spinner/spinner_methods.js deleted file mode 100644 index fb58edbdfbb..00000000000 --- a/tests/unit/spinner/spinner_methods.js +++ /dev/null @@ -1,155 +0,0 @@ -/* - * spinner_methods.js - */ -(function($) { - -module("spinner: methods"); - -test("disable", function() { - var el = $("#spin").spinner({ disabled: false }), - val = el.val(), - wrapper = $("#spin").spinner("widget"); - - ok(!wrapper.hasClass("ui-spinner-disabled"), "before: wrapper does not have ui-spinner-disabled class"); - ok(!el.is(':disabled'), "before: input does not have disabled attribute"); - - el.spinner("disable"); - ok(wrapper.hasClass("ui-spinner-disabled"), "after: wrapper has ui-spinner-disabled class"); - ok(el.is(':disabled'), "after: input has disabled attribute"); - - simulateKeyDownUp(el, $.ui.keyCode.UP); - equals(val, el.val(), "keyboard - value does not change on key UP"); - - simulateKeyDownUp(el, $.ui.keyCode.DOWN); - equals(val, el.val(), "keyboard - value does not change on key DOWN"); - - simulateKeyDownUp(el, $.ui.keyCode.PAGE_UP); - equals(val, el.val(), "keyboard - value does not change on key PGUP"); - - simulateKeyDownUp(el, $.ui.keyCode.PAGE_DOWN); - equals(val, el.val(), "keyboard - value does not change on key PGDN"); - - wrapper.find(":ui-button").first().trigger('mousedown').trigger('mouseup'); - equals(val, el.val(), "mouse - value does not change on clicking up button"); - - wrapper.find(":ui-button").last().trigger('mousedown').trigger('mouseup'); - equals(val, el.val(), "mouse - value does not change on clicking down button"); - - el.spinner('stepUp', 6); - equals(6, el.val(), "script - stepUp 6 steps changes value"); - - el.spinner('stepDown'); - equals(5, el.val(), "script - stepDown 1 step changes value"); - - el.spinner('pageUp'); - equals(15, el.val(), "script - pageUp 1 page changes value"); - - el.spinner('pageDown'); - equals(5, el.val(), "script - pageDown 1 page changes value"); - -}); - -test("enable", function() { - var el = $("#spin").spinner({ disabled: true }) - val = el.val(), - wrapper = el.spinner("widget"); - - ok(wrapper.hasClass("ui-spinner-disabled"), "before: wrapper has ui-spinner-disabled class"); - ok(el.is(':disabled'), "before: input has disabled attribute"); - - el.spinner("enable"); - - ok(!wrapper.hasClass(".ui-spinner-disabled"), "after: wrapper does not have ui-spinner-disabled class"); - ok(!el.is(':disabled'), "after: input does not have disabled attribute"); -}); - -test("pageDown", function() { - var el = $('#spin').spinner({ - step: 2, - value: 0, - min: -100 - }); - - el.spinner('pageDown'); - equals(el.val(), -20, "pageDown 1 page"); - - el.spinner('pageDown', 3); - equals(el.val(), -80, "pageDown 3 pages"); - - el.val(-91).spinner('pageDown'); - equals(el.val(), -100, "value close to min and pageDown 1 page"); - - el.spinner('pageDown', 10); - equals(el.val(), -100, "value at min and pageDown 10 pages"); -}); - -test("pageUp", function() { - var el = $('#spin').spinner({ - step: 2, - value: 0, - max: 100 - }); - - el.spinner('pageUp'); - equals(el.val(), 20, "pageUp 1 page"); - - el.spinner('pageUp', 3); - equals(el.val(), 80, "pageUp 3 pages"); - - el.val(91).spinner('pageUp'); - equals(el.val(), 100, "value close to max and pageUp 1 page"); - - el.spinner('pageUp', 10); - equals(el.val(), 100, "value at max and pageUp 10 pages"); - -}); - -test("stepDown", function() { - expect(4); - - el = $('#spin').spinner({ step: 2, page: 5, value: 0, min: -15 }); - - el.spinner('stepDown') - equals(el.val(), -2, "stepDown 1 step"); - - el.spinner('stepDown', 5) - equals(el.val(), -12, "stepDown 5 steps"); - - el.spinner('stepDown', 3); - equals(el.val(), -15, "close to min and stepDown 3 steps"); - - el.spinner('stepDown'); - equals(el.val(), -15, "at min and stepDown 1 step"); -}); - -test("stepUp", function() { - expect(4); - - el = $('#spin').spinner({ step: 2, page: 5, value: 0, max: 15 }); - - el.spinner('stepUp') - equals(el.val(), 2, "stepUp 1 steps"); - - el.spinner('stepUp', 5) - equals(el.val(), 12, "stepUp 5 steps"); - - el.spinner('stepUp', 3); - equals(el.val(), 15, "close to min and stepUp 3 steps"); - - el.spinner('stepUp'); - equals(el.val(), 15, "at min and stepUp 1 step"); - -}); - -test("value", function() { - expect(2); - - el = $('#spin').spinner({ value: 0 }); - - el.spinner('value', 10); - equals(el.val(), 10, "change value via value method"); - - equals(10, el.spinner('value'), "get value via value method"); -}); - -})(jQuery); diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js deleted file mode 100644 index 3db7e5c5541..00000000000 --- a/tests/unit/spinner/spinner_options.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * spinner_options.js - */ -(function($) { - -module("spinner: options"); - -test("numberformat, number", function() { - var el = $("#spin").spinner({ - value: "1", - numberformat: "n" - }); - equal(el.val(), "1.00"); -}); - -test("numberformat, number, simple", function() { - var el = $("#spin").spinner({ - value: "1", - numberformat: "n0" - }); - equal(el.val(), "1"); -}); - -test("numberformat, currency", function() { - var el = $("#spin").spinner({ - value: "1", - numberformat: "C" - }); - equal(el.val(), "$1.00"); -}); - -/* TODO figure out how to test this properly -test("incremental - false (default)", function() { - var el = $("#spin").spinner({ incremental:false }); - - for ( var i = 1 ; i<=120 ; i++ ) { - el.simulate("keydown",{keyCode:$.ui.keyCode.UP}); - } - el.simulate("keyup",{keyCode:$.ui.keyCode.UP}); - - equals(el.val(), 120, "incremental false - keydown 120 times"); - - for ( var i = 1 ; i<=210 ; i++ ) { - el.simulate("keydown",{keyCode:$.ui.keyCode.DOWN}); - } - el.simulate("keyup",{keyCode:$.ui.keyCode.DOWN}); - - equals(el.val(), -90, "incremental false - keydown 210 times"); -}); - -test("incremental - true (default)", function() { - var el = $("#spin").spinner(); - - for ( var i = 1 ; i<=120 ; i++ ) { - el.simulate("keydown",{keyCode:$.ui.keyCode.UP}); - } - el.simulate("keyup",{keyCode:$.ui.keyCode.UP}); - - equals(el.val(), 300, "incremental true - keydown 120 times (100+20*10)"); - - for ( var i = 1 ; i<=210 ; i++ ) { - el.simulate("keydown",{keyCode:$.ui.keyCode.DOWN}); - } - el.simulate("keyup",{keyCode:$.ui.keyCode.DOWN}); - - equals(el.val(), -1800, "incremental true - keydown 210 times (300-100-100*10-10*100)"); -}); -*/ - -test("max", function() { - var el = $("#spin").spinner({ max: 100, value: 1000 }); - equals(el.val(), 100, "max constrained if value option is greater"); - - el.spinner('value', 1000); - equals(el.val(), 100, "max constrained if value method is greater"); - - el.val(1000).blur(); - equals(el.val(), 100, "max constrained if manual entry"); -}); - -test("min", function() { - var el = $("#spin").spinner({ min: -100, value: -1000 }); - equals(el.val(), -100, "min constrained if value option is greater"); - - el.spinner('value', -1000); - equals(el.val(), -100, "min constrained if value method is greater"); - - el.val(-1000).blur(); - equals(el.val(), -100, "min constrained if manual entry"); -}); - -test("step, 2", function() { - var el = $("#spin").spinner({ step: 2 }); - equals(el.val(), "0", "value initialized to"); - - for ( var i = 0 ; i < 5 ; i++ ) { - simulateKeyDownUp(el, $.ui.keyCode.UP); - } - equals(el.val(), "10", "UP 5 times with step: 2"); - - el.spinner('value', '10.5'); - equals(el.val(), "10.5", "value reset to"); - - el.spinner('option', 'step', 2); - for ( var i = 0 ; i < 5 ; i++ ) { - simulateKeyDownUp(el, $.ui.keyCode.UP); - } - equals(el.val(), "20.5", "UP 5 times with step: 2"); -}); - -test("step, 0.7", function() { - var el = $("#spin").spinner({ - step: 0.7, - numberformat: "n1" - }); - equals(el.val(), "0.0", "value initialized to"); - - simulateKeyDownUp(el, $.ui.keyCode.DOWN); - equals(el.val(), "-0.7", "DOWN 1 time with step: 0.7"); - - for ( var i = 0 ; i < 11 ; i++ ) { - simulateKeyDownUp(el, $.ui.keyCode.UP); - } - equals(el.val(), "7.0", "UP 11 times with step: 0.7"); -}); - -test("value, default, specified in markup", function() { - var el = $('#spin2').spinner(); - equals(el.val(), 2, "starting value"); -}); - -test("value, default, nothing specified", function() { - var el = $('#spin').spinner(); - equals(el.val(), 0, "starting value"); -}); - -test("value, override", function() { - var el = $('#spin').spinner({ value: 100 }); - equals(el.val(), 100, "starting value"); -}); - -test("value, override markup", function() { - var el = $('#spin2').spinner({ value: 100 }); - equals(el.val(), 100, "starting value"); -}); - -test("value, override later", function() { - var el = $('#spin').spinner(); - equals(el.val(), 0, "starting value"); - el.spinner('option', 'value', 1000); - equals(el.val(), 1000, "value option changed and set as current value"); -}); - -})(jQuery); diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index 3935082a1c7..59b99ef37e4 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -61,7 +61,7 @@

  • 1
  • 2
  • 3
  • -
  • 4
  • +
  • 4
  • @@ -107,14 +107,6 @@

    -
    -
      -
    • 1
    • -
    • 2
    • -
    -
    -
    -
    diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js index bfd9d7713d4..abd43d8f00a 100644 --- a/tests/unit/tabs/tabs_methods.js +++ b/tests/unit/tabs/tabs_methods.js @@ -21,42 +21,6 @@ test('init', function() { equals( $('div', el).index( $('div.ui-tabs-hide', '#tabs1') ), 1, 'second panel should be hidden' ); }); -test('init with hash', function() { - expect(5); - - //set a hash in the url - location.hash = '#fragment-2'; - - //selection of tab with divs ordered differently than list - el = $('#tabs1').tabs(); - - equals(el.tabs('option', 'selected'), 1, 'second tab should be selected'); - - ok(!$('#tabs1 ul li:eq(0)').is('.ui-tabs-selected.ui-state-active'), 'first tab should not be selected nor active'); - ok($('#tabs1 div:eq(0)').is('.ui-tabs-hide'), 'first div for first tab should be hidden'); - - ok($('#tabs1 ul li:eq(1)').is('.ui-tabs-selected.ui-state-active'), 'second tab should be selected and active'); - ok(!$('#tabs1 div:eq(1)').is('.ui-tabs-hide'), 'second div for second tab should not be hidden'); -}); - -test('init mismatched order with hash', function() { - expect(5); - - //set a hash in the url - location.hash = '#tabs7-2'; - - //selection of tab with divs ordered differently than list - el = $('#tabs7').tabs(); - - equals(el.tabs('option', 'selected'), 1, 'second tab should be selected'); - - ok(!$('#tabs7-list li:eq(0)').is('.ui-tabs-selected.ui-state-active'), 'first tab should not be selected nor active'); - ok($('#tabs7 div:eq(1)').is('.ui-tabs-hide'), 'second div for first tab should be hidden'); - - ok($('#tabs7-list li:eq(1)').is('.ui-tabs-selected.ui-state-active'), 'second tab should be selected and active'); - ok(!$('#tabs7 div:eq(0)').is('.ui-tabs-hide'), 'first div for second tab should not be hidden'); -}); - test('destroy', function() { expect(6); diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html deleted file mode 100644 index 33c75439408..00000000000 --- a/tests/unit/tooltip/tooltip.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - jQuery UI Tooltip Test Suite - - - - - - - - - - - - - - - - - - - - - - - - -

    jQuery UI Tooltip Test Suite

    -

    -

    -
      -
    - -
    -
    - anchor - -
    -
    - - - diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js deleted file mode 100644 index 247927df4f7..00000000000 --- a/tests/unit/tooltip/tooltip_core.js +++ /dev/null @@ -1,11 +0,0 @@ -/* - * tooltip_core.js - */ - - -(function($) { - -module("tooltip: core"); - - -})(jQuery); diff --git a/tests/unit/tooltip/tooltip_defaults.js b/tests/unit/tooltip/tooltip_defaults.js deleted file mode 100644 index 419d7a08520..00000000000 --- a/tests/unit/tooltip/tooltip_defaults.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * tooltip_defaults.js - */ - -var tooltip_defaults = { - disabled: false, - items: "[title]", - content: $.ui.tooltip.prototype.options.content, - position: { - my: "left center", - at: "right center", - offset: "15 0" - } -}; - -commonWidgetTests('tooltip', { defaults: tooltip_defaults }); diff --git a/tests/unit/tooltip/tooltip_events.js b/tests/unit/tooltip/tooltip_events.js deleted file mode 100644 index 35620df471d..00000000000 --- a/tests/unit/tooltip/tooltip_events.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * tooltip_events.js - */ -(function($) { - -module("tooltip: events"); - -test("programmatic triggers", function() { - expect(2); - var e = $("#tooltipped1").tooltip({ - open: function(event, ui) { - same( event.type, "tooltipopen" ); - }, - close: function(event, ui) { - same( event.type, "tooltipclose" ); - } - }); - e.tooltip("open").tooltip("close"); - e.tooltip("destroy"); -}); - -test("mouse events", function() { - expect(4); - var e = $("#tooltipped1").tooltip({ - open: function(event, ui) { - same( event.type, "tooltipopen" ); - same( event.originalEvent.type, "mouseover" ); - }, - close: function(event, ui) { - same( event.type, "tooltipclose" ); - same( event.originalEvent.type, "mouseout" ); - } - }); - e.trigger("mouseover").trigger("mouseout"); - e.tooltip("destroy"); -}); - -test("focus events", function() { - expect(4); - var e = $("#tooltipped1").tooltip({ - open: function(event, ui) { - same( event.type, "tooltipopen" ); - same( event.originalEvent.type, "focus" ); - }, - close: function(event, ui) { - same( event.type, "tooltipclose" ); - same( event.originalEvent.type, "blur" ); - } - }); - e.trigger("focus").trigger("blur"); - e.tooltip("destroy"); -}); - -})(jQuery); diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js deleted file mode 100644 index ace1a128846..00000000000 --- a/tests/unit/tooltip/tooltip_methods.js +++ /dev/null @@ -1,30 +0,0 @@ -/* - * tooltip_methods.js - */ -(function($) { - - -module("tooltip: methods"); - -test("destroy", function() { - var beforeHtml = $("#tooltipped1").parent().html(); - var afterHtml = $("#tooltipped1").tooltip().tooltip("destroy").parent().html(); - equal( afterHtml, beforeHtml ); -}); - -test("open", function() { - var e = $("#tooltipped1").tooltip(); - ok( $(".ui-tooltip").is(":hidden") ); - e.tooltip("open"); - ok( $(".ui-tooltip").is(":visible") ); - $(":ui-tooltip").tooltip("destroy"); -}); - -test("widget", function() { - var tooltip = $("#tooltipped1").tooltip(); - same(tooltip.tooltip("widget")[0], $(".ui-tooltip")[0]); - same(tooltip.tooltip("widget").end()[0], tooltip[0]); -}); - - -})(jQuery); diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js deleted file mode 100644 index 6962d1e8600..00000000000 --- a/tests/unit/tooltip/tooltip_options.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * tooltip_options.js - */ -(function($) { - -module("tooltip: options", { - teardown: function() { - $(":ui-tooltip").tooltip("destroy"); - } -}); - - -test("option: items", function() { - ok(false, "missing items test"); -}); - -test("content: default", function() { - $("#tooltipped1").tooltip().tooltip("open"); - same( $(".ui-tooltip").text(), "anchortitle" ); -}); - -test("content: return string", function() { - $("#tooltipped1").tooltip({ - content: function() { - return "customstring"; - } - }).tooltip("open"); - same( $(".ui-tooltip").text(), "customstring" ); -}); - -test("content: return jQuery", function() { - $("#tooltipped1").tooltip({ - content: function() { - return $("
    ").html("customstring"); - } - }).tooltip("open"); - same( $(".ui-tooltip").text(), "customstring" ); -}); - -test("content: callback string", function() { - stop(); - $("#tooltipped1").tooltip({ - content: function(response) { - response("customstring2"); - setTimeout(function() { - same( $(".ui-tooltip").text(), "customstring2" ); - start(); - }, 100) - } - }).tooltip("open"); - -}); - -})(jQuery); diff --git a/tests/unit/tooltip/tooltip_tickets.js b/tests/unit/tooltip/tooltip_tickets.js deleted file mode 100644 index 5d6d0ef86b6..00000000000 --- a/tests/unit/tooltip/tooltip_tickets.js +++ /dev/null @@ -1,10 +0,0 @@ -/* - * tooltip_tickets.js - */ -(function($) { - -module("tooltip: tickets"); - - - -})(jQuery); diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js index c01cd65428e..480cab4e72f 100644 --- a/tests/unit/widget/widget_core.js +++ b/tests/unit/widget/widget_core.js @@ -27,14 +27,14 @@ test( "widget creation", function() { }); test( "jQuery usage", function() { - expect( 11 ); + expect( 10 ); - var shouldCreate = false; + var shouldInit = false; $.widget( "ui.testWidget", { getterSetterVal: 5, _create: function() { - ok( shouldCreate, "create called on instantiation" ); + ok( shouldInit, "init called on instantiation" ); }, methodWithParams: function( param1, param2 ) { ok( true, "method called via .pluginName(methodName)" ); @@ -54,13 +54,9 @@ test( "jQuery usage", function() { } }); - shouldCreate = true; - var elem = $( "
    " ) - .bind( "testwidgetcreate", function() { - ok( shouldCreate, "create event triggered on instantiation" ); - }) - .testWidget(); - shouldCreate = false; + shouldInit = true; + var elem = $( "
    " ).testWidget(); + shouldInit = false; var instance = elem.data( "testWidget" ); equals( typeof instance, "object", "instance stored in .data(pluginName)" ); @@ -78,12 +74,12 @@ test( "jQuery usage", function() { test( "direct usage", function() { expect( 9 ); - var shouldCreate = false; + var shouldInit = false; $.widget( "ui.testWidget", { getterSetterVal: 5, _create: function() { - ok( shouldCreate, "create called on instantiation" ); + ok( shouldInit, "init called on instantiation" ); }, methodWithParams: function( param1, param2 ) { ok( true, "method called dirctly" ); @@ -103,9 +99,9 @@ test( "direct usage", function() { var elem = $( "
    " )[ 0 ]; - shouldCreate = true; + shouldInit = true; var instance = new $.ui.testWidget( {}, elem ); - shouldCreate = false; + shouldInit = false; equals( $( elem ).data( "testWidget" ), instance, "instance stored in .data(pluginName)" ); @@ -173,32 +169,6 @@ test("merge multiple option arguments", function() { }); }); -test( "_getCreateOptions()", function() { - expect( 1 ); - $.widget( "ui.testWidget", { - options: { - option1: "valuex", - option2: "valuex", - option3: "value3", - }, - _getCreateOptions: function() { - return { - option1: "override1", - option2: "overideX", - }; - }, - _create: function() { - same( this.options, { - disabled: false, - option1: "override1", - option2: "value2", - option3: "value3" - }); - } - }); - $( "
    " ).testWidget({ option2: "value2" }); -}); - test( "re-init", function() { var div = $( "
    " ), actions = []; diff --git a/tests/visual/accordion/accordion_option_fillSpace_true.html b/tests/visual/accordion/accordion_option_fillSpace_true.html index 7642d06214c..5d433097d71 100644 --- a/tests/visual/accordion/accordion_option_fillSpace_true.html +++ b/tests/visual/accordion/accordion_option_fillSpace_true.html @@ -20,7 +20,6 @@
    -

    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ultricies enim augue. Vestibulum quis risus massa. Donec ut augue vitae velit dignissim auctor ac eleifend nisi. Donec et urna sapien. Donec bibendum rhoncus erat sit amet suscipit. Ut sodales vestibulum urna, blandit tempor enim sodales ac. Integer sagittis mauris nec sapien ornare ut malesuada nunc egestas. Ut auctor metus eget leo imperdiet non cursus velit rutrum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed consectetur euismod ipsum ac sodales. Proin volutpat, est non ultricies iaculis, augue orci pulvinar lectus, quis tincidunt nibh odio a augue. Sed posuere interdum augue a consequat. Ut ac nunc nulla, quis aliquet purus. Nullam convallis elit id magna pretium pretium. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce commodo, ipsum ac ultrices porta, purus leo suscipit dui, sit amet ultricies ligula ante a dui. Morbi a sem quam, quis rhoncus quam.

    Accordion Header 1

    diff --git a/tests/visual/addClass/addClass_queue.html b/tests/visual/addClass/addClass_queue.html deleted file mode 100644 index 27c3848a7d5..00000000000 --- a/tests/visual/addClass/addClass_queue.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - addClass Visual Test : Queue - - - - - - - - - -
    -
    - - - diff --git a/tests/visual/all.html b/tests/visual/all.html index c50465a477b..4bbd323b0bf 100644 --- a/tests/visual/all.html +++ b/tests/visual/all.html @@ -11,7 +11,6 @@ - diff --git a/tests/visual/autocomplete/autocomplete.html b/tests/visual/autocomplete/autocomplete.html index 199451e9c03..9b0ba66f689 100644 --- a/tests/visual/autocomplete/autocomplete.html +++ b/tests/visual/autocomplete/autocomplete.html @@ -9,7 +9,6 @@ - - - - - - - - - - -
    - -
    - label -
    - -
    - - - diff --git a/tests/visual/compound/widgets_in_dialog.html b/tests/visual/compound/widgets_in_dialog.html index 809ee5656f3..11120ea2481 100644 --- a/tests/visual/compound/widgets_in_dialog.html +++ b/tests/visual/compound/widgets_in_dialog.html @@ -13,18 +13,15 @@ - + - @@ -79,11 +76,11 @@

    Accordion Header 3

    - +
    -
    +
    @@ -42,19 +41,9 @@

    Widgets

  • Button
  • Datepicker
  • Dialog
  • -
  • - Menu - -
  • Progressbar
  • Slider
  • -
  • Spinner
  • Tabs
  • -
  • Tooltip
  • diff --git a/tests/visual/menu/contextmenu.html b/tests/visual/menu/contextmenu.html index d3fdc4e7c29..eb328abf065 100644 --- a/tests/visual/menu/contextmenu.html +++ b/tests/visual/menu/contextmenu.html @@ -8,7 +8,7 @@ - + - - + - + + - - - - - -
    - Log: -
    -
    - - - diff --git a/tests/visual/menu/nested.html b/tests/visual/menu/nested.html index 2508c55c4d4..c7f9a09143a 100644 --- a/tests/visual/menu/nested.html +++ b/tests/visual/menu/nested.html @@ -8,8 +8,8 @@ - - + + - + - - - - - - - - - - -

    - - \ No newline at end of file diff --git a/tests/visual/tooltip/ajaxcontent.php b/tests/visual/tooltip/ajaxcontent.php deleted file mode 100644 index a689a734dc4..00000000000 --- a/tests/visual/tooltip/ajaxcontent.php +++ /dev/null @@ -1,2 +0,0 @@ - -Hello world! \ No newline at end of file diff --git a/tests/visual/tooltip/callout.html b/tests/visual/tooltip/callout.html deleted file mode 100644 index 3ef6949874b..00000000000 --- a/tests/visual/tooltip/callout.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - Tooltip Visual Test: Default - - - - - - - - - - - - - -
    - - -
    - collision detection should kick in around here -
    - - - -
    - right aligned with custom position -
    - -
    - gets its content via ajax -
    - -
    - span -
    - div - nested span -
    -
    - -
    -
    - - -
    -
    - - -
    -
    - -
    This is the footnote, including other elements
    - - - -
    - - - - diff --git a/tests/visual/tooltip/tooltip.html b/tests/visual/tooltip/tooltip.html deleted file mode 100644 index fb2690a54d8..00000000000 --- a/tests/visual/tooltip/tooltip.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - Tooltip Visual Test: Default - - - - - - - - - - - - - -
    - - -
    - collision detection should kick in around here -
    - - - -
    - right aligned with custom position -
    - -
    - gets its content via ajax -
    -
    - gets its content via ajax, caches the response -
    - -
    - span -
    - div - nested span -
    -
    - -
    - Text in bold. -
    - -
    -
    - - -
    -
    - - -
    -
    - -
    - - - - -
    - -
    This is the footnote, including other elements
    -
    This is the other footnote, including other elements
    - - - -
    - -
    - - - diff --git a/themes/base/jquery.ui.accordion.css b/themes/base/jquery.ui.accordion.css index 23446e1f64e..80a80c82c06 100644 --- a/themes/base/jquery.ui.accordion.css +++ b/themes/base/jquery.ui.accordion.css @@ -1,7 +1,7 @@ /* * jQuery UI Accordion @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.all.css b/themes/base/jquery.ui.all.css index 0302dfb961e..96b15aa515b 100644 --- a/themes/base/jquery.ui.all.css +++ b/themes/base/jquery.ui.all.css @@ -1,7 +1,7 @@ /* * jQuery UI CSS Framework @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.autocomplete.css b/themes/base/jquery.ui.autocomplete.css index aab7e8d636c..0d30d77a561 100644 --- a/themes/base/jquery.ui.autocomplete.css +++ b/themes/base/jquery.ui.autocomplete.css @@ -1,7 +1,7 @@ /* * jQuery UI Autocomplete @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -11,3 +11,43 @@ /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu @VERSION + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} diff --git a/themes/base/jquery.ui.base.css b/themes/base/jquery.ui.base.css index 733cb755e5a..21703833e06 100644 --- a/themes/base/jquery.ui.base.css +++ b/themes/base/jquery.ui.base.css @@ -1,7 +1,7 @@ /* * jQuery UI CSS Framework @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -14,11 +14,8 @@ @import url("jquery.ui.button.css"); @import url("jquery.ui.datepicker.css"); @import url("jquery.ui.dialog.css"); -@import url("jquery.ui.menu.css"); @import url("jquery.ui.progressbar.css"); @import url("jquery.ui.resizable.css"); @import url("jquery.ui.selectable.css"); @import url("jquery.ui.slider.css"); -@import url("jquery.ui.spinner.css"); @import url("jquery.ui.tabs.css"); -@import url("jquery.ui.tooltip.css"); diff --git a/themes/base/jquery.ui.button.css b/themes/base/jquery.ui.button.css index 00c2b3b1598..0d11065f4de 100644 --- a/themes/base/jquery.ui.button.css +++ b/themes/base/jquery.ui.button.css @@ -1,7 +1,7 @@ /* * jQuery UI Button @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.core.css b/themes/base/jquery.ui.core.css index 5cb485cd1c5..59e14d572b3 100644 --- a/themes/base/jquery.ui.core.css +++ b/themes/base/jquery.ui.core.css @@ -1,7 +1,7 @@ /* * jQuery UI CSS Framework @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.datepicker.css b/themes/base/jquery.ui.datepicker.css index f9098e3a7f3..f457800f4b0 100644 --- a/themes/base/jquery.ui.datepicker.css +++ b/themes/base/jquery.ui.datepicker.css @@ -1,7 +1,7 @@ /* * jQuery UI Datepicker @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.dialog.css b/themes/base/jquery.ui.dialog.css index 0354644473f..12609ed1923 100644 --- a/themes/base/jquery.ui.dialog.css +++ b/themes/base/jquery.ui.dialog.css @@ -1,15 +1,15 @@ /* * jQuery UI Dialog @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming */ .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } diff --git a/themes/base/jquery.ui.menu.css b/themes/base/jquery.ui.menu.css deleted file mode 100644 index 667518bffca..00000000000 --- a/themes/base/jquery.ui.menu.css +++ /dev/null @@ -1,37 +0,0 @@ -/* - * jQuery UI Menu @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a { - font-weight: normal; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} diff --git a/themes/base/jquery.ui.progressbar.css b/themes/base/jquery.ui.progressbar.css index 50fe84a6f4a..38364fafa22 100644 --- a/themes/base/jquery.ui.progressbar.css +++ b/themes/base/jquery.ui.progressbar.css @@ -1,7 +1,7 @@ /* * jQuery UI Progressbar @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.resizable.css b/themes/base/jquery.ui.resizable.css index 3b86c7c3a33..eeb547b9f6f 100644 --- a/themes/base/jquery.ui.resizable.css +++ b/themes/base/jquery.ui.resizable.css @@ -1,7 +1,7 @@ /* * jQuery UI Resizable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.selectable.css b/themes/base/jquery.ui.selectable.css index de2f7f3b64f..5177f6b1f32 100644 --- a/themes/base/jquery.ui.selectable.css +++ b/themes/base/jquery.ui.selectable.css @@ -1,7 +1,7 @@ /* * jQuery UI Selectable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.slider.css b/themes/base/jquery.ui.slider.css index 0b1d31e94aa..8d9b403a90b 100644 --- a/themes/base/jquery.ui.slider.css +++ b/themes/base/jquery.ui.slider.css @@ -1,7 +1,7 @@ /* * jQuery UI Slider @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.spinner.css b/themes/base/jquery.ui.spinner.css deleted file mode 100644 index cd195ee47ec..00000000000 --- a/themes/base/jquery.ui.spinner.css +++ /dev/null @@ -1,16 +0,0 @@ -/* Spinner -----------------------------------*/ -.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; } -.ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; } -.ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; z-index: 100; text-align: center; vertical-align: middle; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; } -.ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */ -.ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */ -.ui-spinner-up { top: 0; } -.ui-spinner-down { bottom: 0; } - -/* TR overrides */ -span.ui-spinner { background: none; } -.ui-spinner .ui-icon-triangle-1-s { - /* need to fix icons sprite */ - background-position:-65px -16px; -} diff --git a/themes/base/jquery.ui.tabs.css b/themes/base/jquery.ui.tabs.css index 5b3b58e81e8..12666facd59 100644 --- a/themes/base/jquery.ui.tabs.css +++ b/themes/base/jquery.ui.tabs.css @@ -1,7 +1,7 @@ /* * jQuery UI Tabs @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css index 92205438451..7d4398465c8 100644 --- a/themes/base/jquery.ui.theme.css +++ b/themes/base/jquery.ui.theme.css @@ -1,7 +1,7 @@ /* * jQuery UI CSS Framework @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/themes/base/jquery.ui.tooltip.css b/themes/base/jquery.ui.tooltip.css deleted file mode 100644 index 145b079d2b8..00000000000 --- a/themes/base/jquery.ui.tooltip.css +++ /dev/null @@ -1,16 +0,0 @@ -/* Tooltip -----------------------------------*/ -.ui-tooltip { - padding:8px; - position:absolute; - z-index:9999; - -o-box-shadow: 0 0 5px #aaa; - -moz-box-shadow: 0 0 5px #aaa; - -webkit-box-shadow: 0 0 5px #aaa; - box-shadow: 0 0 5px #aaa; -} -/* Fades and background-images don't work well together in IE6, drop the image */ -* html .ui-tooltip { - background-image: none; -} -body .ui-tooltip { border-width:2px; } diff --git a/ui/i18n/jquery.ui.datepicker-ar-DZ.js b/ui/i18n/jquery.ui.datepicker-ar-DZ.js new file mode 100644 index 00000000000..e0e1685d845 --- /dev/null +++ b/ui/i18n/jquery.ui.datepicker-ar-DZ.js @@ -0,0 +1,23 @@ +/* Algerian Arabic Translation for jQuery UI date picker plugin. (can be used for Tunisia)*/ +/* Mohamed Cherif BOUCHELAGHEM -- cherifbouchelaghem@yahoo.fr */ + +jQuery(function($){ + $.datepicker.regional['ar-DZ'] = { + closeText: 'إغلاق', + prevText: '<السابق', + nextText: 'التالي>', + currentText: 'اليوم', + monthNames: ['جانفي', 'فيفري', 'مارس', 'أفريل', 'ماي', 'جوان', + 'جويلية', 'أوت', 'سبتمبر','أكتوبر', 'نوفمبر', 'ديسمبر'], + monthNamesShort: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'], + dayNames: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesShort: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + dayNamesMin: ['الأحد', 'الاثنين', 'الثلاثاء', 'الأربعاء', 'الخميس', 'الجمعة', 'السبت'], + weekHeader: 'أسبوع', + dateFormat: 'dd/mm/yy', + firstDay: 6, + isRTL: true, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ar-DZ']); +}); diff --git a/ui/i18n/jquery.ui.datepicker-en-AU.js b/ui/i18n/jquery.ui.datepicker-en-AU.js new file mode 100644 index 00000000000..c1a1020a140 --- /dev/null +++ b/ui/i18n/jquery.ui.datepicker-en-AU.js @@ -0,0 +1,23 @@ +/* English/Australia initialisation for the jQuery UI date picker plugin. */ +/* Based on the en-GB initialisation. */ +jQuery(function($){ + $.datepicker.regional['en-AU'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['en-AU']); +}); diff --git a/ui/i18n/jquery.ui.datepicker-en-NZ.js b/ui/i18n/jquery.ui.datepicker-en-NZ.js new file mode 100644 index 00000000000..7819df05286 --- /dev/null +++ b/ui/i18n/jquery.ui.datepicker-en-NZ.js @@ -0,0 +1,23 @@ +/* English/New Zealand initialisation for the jQuery UI date picker plugin. */ +/* Based on the en-GB initialisation. */ +jQuery(function($){ + $.datepicker.regional['en-NZ'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], + weekHeader: 'Wk', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['en-NZ']); +}); diff --git a/ui/i18n/jquery.ui.datepicker-hu.js b/ui/i18n/jquery.ui.datepicker-hu.js index 249e7b0ef4f..46e63f59b2a 100644 --- a/ui/i18n/jquery.ui.datepicker-hu.js +++ b/ui/i18n/jquery.ui.datepicker-hu.js @@ -17,7 +17,7 @@ jQuery(function($){ dateFormat: 'yy-mm-dd', firstDay: 1, isRTL: false, - showMonthAfterYear: false, + showMonthAfterYear: true, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['hu']); }); diff --git a/ui/i18n/jquery.ui.datepicker-ml.js b/ui/i18n/jquery.ui.datepicker-ml.js new file mode 100644 index 00000000000..753dba411d1 --- /dev/null +++ b/ui/i18n/jquery.ui.datepicker-ml.js @@ -0,0 +1,23 @@ +/* Malayalam (UTF-8) initialisation for the jQuery UI date picker plugin. */ +/* Written by Saji Nediyanchath (saji89@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['ml'] = { + closeText: 'ശരി', + prevText: 'മുന്നത്തെ', + nextText: 'അടുത്തത് ', + currentText: 'ഇന്ന്', + monthNames: ['ജനുവരി','ഫെബ്രുവരി','മാര്‍ച്ച്','ഏപ്രില്‍','മേയ്','ജൂണ്‍', + 'ജൂലൈ','ആഗസ്റ്റ്','സെപ്റ്റംബര്‍','ഒക്ടോബര്‍','നവംബര്‍','ഡിസംബര്‍'], + monthNamesShort: ['ജനു', 'ഫെബ്', 'മാര്‍', 'ഏപ്രി', 'മേയ്', 'ജൂണ്‍', + 'ജൂലാ', 'ആഗ', 'സെപ്', 'ഒക്ടോ', 'നവം', 'ഡിസ'], + dayNames: ['ഞായര്‍', 'തിങ്കള്‍', 'ചൊവ്വ', 'ബുധന്‍', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], + dayNamesShort: ['ഞായ', 'തിങ്ക', 'ചൊവ്വ', 'ബുധ', 'വ്യാഴം', 'വെള്ളി', 'ശനി'], + dayNamesMin: ['ഞാ','തി','ചൊ','ബു','വ്യാ','വെ','ശ'], + weekHeader: 'ആ', + dateFormat: 'dd/mm/yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: ''}; + $.datepicker.setDefaults($.datepicker.regional['ml']); +}); diff --git a/ui/i18n/jquery.ui.datepicker-no.js b/ui/i18n/jquery.ui.datepicker-no.js index 6b3a498be55..2507043a3f2 100644 --- a/ui/i18n/jquery.ui.datepicker-no.js +++ b/ui/i18n/jquery.ui.datepicker-no.js @@ -1,23 +1,23 @@ /* Norwegian initialisation for the jQuery UI date picker plugin. */ /* Written by Naimdjon Takhirov (naimdjon@gmail.com). */ + jQuery(function($){ - $.datepicker.regional['no'] = { - closeText: 'Lukk', - prevText: '«Forrige', - nextText: 'Neste»', - currentText: 'I dag', - monthNames: ['Januar','Februar','Mars','April','Mai','Juni', - 'Juli','August','September','Oktober','November','Desember'], - monthNamesShort: ['Jan','Feb','Mar','Apr','Mai','Jun', - 'Jul','Aug','Sep','Okt','Nov','Des'], - dayNamesShort: ['Søn','Man','Tir','Ons','Tor','Fre','Lør'], - dayNames: ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag'], - dayNamesMin: ['Sø','Ma','Ti','On','To','Fr','Lø'], - weekHeader: 'Uke', - dateFormat: 'dd.mm.yy', - firstDay: 1, - isRTL: false, - showMonthAfterYear: false, - yearSuffix: ''}; - $.datepicker.setDefaults($.datepicker.regional['no']); + $.datepicker.regional['no'] = { + closeText: 'Lukk', + prevText: '«Forrige', + nextText: 'Neste»', + currentText: 'I dag', + monthNames: ['januar','februar','mars','april','mai','juni','juli','august','september','oktober','november','desember'], + monthNamesShort: ['jan','feb','mar','apr','mai','jun','jul','aug','sep','okt','nov','des'], + dayNamesShort: ['søn','man','tir','ons','tor','fre','lør'], + dayNames: ['søndag','mandag','tirsdag','onsdag','torsdag','fredag','lørdag'], + dayNamesMin: ['sø','ma','ti','on','to','fr','lø'], + weekHeader: 'Uke', + dateFormat: 'dd.mm.yy', + firstDay: 1, + isRTL: false, + showMonthAfterYear: false, + yearSuffix: '' + }; + $.datepicker.setDefaults($.datepicker.regional['no']); }); diff --git a/ui/i18n/jquery.ui.datepicker-ru.js b/ui/i18n/jquery.ui.datepicker-ru.js index 50a4613523c..b8091f9eccd 100644 --- a/ui/i18n/jquery.ui.datepicker-ru.js +++ b/ui/i18n/jquery.ui.datepicker-ru.js @@ -13,7 +13,7 @@ jQuery(function($){ dayNames: ['воскресенье','понедельник','вторник','среда','четверг','пятница','суббота'], dayNamesShort: ['вск','пнд','втр','срд','чтв','птн','сбт'], dayNamesMin: ['Вс','Пн','Вт','Ср','Чт','Пт','Сб'], - weekHeader: 'Нед', + weekHeader: 'Не', dateFormat: 'dd.mm.yy', firstDay: 1, isRTL: false, diff --git a/ui/jquery.effects.blind.js b/ui/jquery.effects.blind.js index 44f398a556f..f1b823533f5 100644 --- a/ui/jquery.effects.blind.js +++ b/ui/jquery.effects.blind.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Blind @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.bounce.js b/ui/jquery.effects.bounce.js index ec4a77ec418..055b4759679 100644 --- a/ui/jquery.effects.bounce.js +++ b/ui/jquery.effects.bounce.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Bounce @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.clip.js b/ui/jquery.effects.clip.js index 9fa8df94ae7..c0fe450c98f 100644 --- a/ui/jquery.effects.clip.js +++ b/ui/jquery.effects.clip.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Clip @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.core.js b/ui/jquery.effects.core.js index bb88dcf19f6..ae9a328ea1f 100644 --- a/ui/jquery.effects.core.js +++ b/ui/jquery.effects.core.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -19,7 +19,7 @@ $.effects = {}; // override the animation for color styles $.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', - 'borderRightColor', 'borderTopColor', 'borderColor', 'color', 'outlineColor'], + 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i, attr) { $.fx.step[attr] = function(fx) { if (!fx.colorInit) { @@ -462,29 +462,15 @@ function standardSpeed( speed ) { $.fn.extend({ effect: function(effect, options, speed, callback) { var args = _normalizeArguments.apply(this, arguments), - // TODO: make effects take actual parameters instead of a hash + // TODO: make effects takes actual parameters instead of a hash args2 = { options: args[1], duration: args[2], callback: args[3] }, - mode = args2.options.mode, effectMethod = $.effects[effect]; - if ( $.fx.off || !effectMethod ) { - // delegate to the original method (e.g., .show()) if possible - if ( mode ) { - return this[ mode ]( args2.duration, args2.callback ); - } else { - return this.each(function() { - if ( args2.callback ) { - args2.callback.call( this ); - } - }); - } - } - - return effectMethod.call(this, args2); + return effectMethod && !$.fx.off ? effectMethod.call(this, args2) : this; }, _show: $.fn.show, diff --git a/ui/jquery.effects.drop.js b/ui/jquery.effects.drop.js index 941508b2ecc..f13dda856c9 100644 --- a/ui/jquery.effects.drop.js +++ b/ui/jquery.effects.drop.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Drop @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.explode.js b/ui/jquery.effects.explode.js index 05d9bcd3945..80e12770fb2 100644 --- a/ui/jquery.effects.explode.js +++ b/ui/jquery.effects.explode.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Explode @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.fade.js b/ui/jquery.effects.fade.js index 40483ee0c6a..9fa8a79c412 100644 --- a/ui/jquery.effects.fade.js +++ b/ui/jquery.effects.fade.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Fade @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.fold.js b/ui/jquery.effects.fold.js index f19ae1bf2ff..fa98ee2dd45 100644 --- a/ui/jquery.effects.fold.js +++ b/ui/jquery.effects.fold.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Fold @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.highlight.js b/ui/jquery.effects.highlight.js index bd6d21b2528..9a3edc5bcfe 100644 --- a/ui/jquery.effects.highlight.js +++ b/ui/jquery.effects.highlight.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Highlight @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.pulsate.js b/ui/jquery.effects.pulsate.js index 4d325c4e112..8eb9990176c 100644 --- a/ui/jquery.effects.pulsate.js +++ b/ui/jquery.effects.pulsate.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Pulsate @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.scale.js b/ui/jquery.effects.scale.js index d980882db5b..281021380fb 100644 --- a/ui/jquery.effects.scale.js +++ b/ui/jquery.effects.scale.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Scale @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.shake.js b/ui/jquery.effects.shake.js index b94e5a5abf2..14c94180936 100644 --- a/ui/jquery.effects.shake.js +++ b/ui/jquery.effects.shake.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Shake @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.slide.js b/ui/jquery.effects.slide.js index 59f6dc578e6..35a584fd98e 100644 --- a/ui/jquery.effects.slide.js +++ b/ui/jquery.effects.slide.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Slide @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.effects.transfer.js b/ui/jquery.effects.transfer.js index 2741e9d4b4c..4b4c4105076 100644 --- a/ui/jquery.effects.transfer.js +++ b/ui/jquery.effects.transfer.js @@ -1,7 +1,7 @@ /* * jQuery UI Effects Transfer @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 955030ccca0..894174caa5a 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -1,7 +1,7 @@ /* * jQuery UI Accordion @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -17,11 +17,12 @@ $.widget( "ui.accordion", { options: { active: 0, animated: "slide", + autoHeight: true, + clearStyle: false, collapsible: false, event: "click", + fillSpace: false, header: "> li > :first-child,> :not(li):even", - // TODO: set to "auto" in 2.0 (#5868, #5872) - heightStyle: null, // "auto" icons: { header: "ui-icon-triangle-1-e", headerSelected: "ui-icon-triangle-1-s" @@ -164,7 +165,7 @@ $.widget( "ui.accordion", { .css( "display", "" ) .removeAttr( "role" ) .removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" ); - if ( options.heightStyle !== "content" ) { + if ( options.autoHeight || options.fillHeight ) { contents.css( "height", "" ); } @@ -173,7 +174,7 @@ $.widget( "ui.accordion", { _setOption: function( key, value ) { $.Widget.prototype._setOption.apply( this, arguments ); - + if ( key == "active" ) { this.activate( value ); } @@ -187,7 +188,8 @@ $.widget( "ui.accordion", { // so we need to add the disabled class to the headers and panels if ( key == "disabled" ) { this.headers.add(this.headers.next()) - .toggleClass( "ui-accordion-disabled ui-state-disabled", !!value ); + [ value ? "addClass" : "removeClass" ]( + "ui-accordion-disabled ui-state-disabled" ); } }, @@ -230,21 +232,12 @@ $.widget( "ui.accordion", { var options = this.options, maxHeight; - if ( options.heightStyle === "fill" ) { + if ( options.fillSpace ) { if ( $.browser.msie ) { var defOverflow = this.element.parent().css( "overflow" ); this.element.parent().css( "overflow", "hidden"); } maxHeight = this.element.parent().height(); - this.element.siblings( ":visible" ).each(function() { - var elem = $( this ), - position = elem.css( "position" ); - - if ( position === "absolute" || position === "fixed" ) { - return; - } - maxHeight -= elem.outerHeight( true ); - }); if ($.browser.msie) { this.element.parent().css( "overflow", defOverflow ); } @@ -259,7 +252,7 @@ $.widget( "ui.accordion", { $( this ).innerHeight() + $( this ).height() ) ); }) .css( "overflow", "auto" ); - } else if ( options.heightStyle === "auto" ) { + } else if ( options.autoHeight ) { maxHeight = 0; this.headers.next() .each(function() { @@ -338,8 +331,26 @@ $.widget( "ui.accordion", { return; } + // find elements to show and hide + var active = this.active, + toShow = clicked.next(), + toHide = this.active.next(), + data = { + options: options, + newHeader: clickedIsActive && options.collapsible ? $([]) : clicked, + oldHeader: this.active, + newContent: clickedIsActive && options.collapsible ? $([]) : toShow, + oldContent: toHide + }, + down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); + + // when the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $([]) : clicked; + this._toggle( toShow, toHide, data, clickedIsActive, down ); + // switch classes - this.active + active .removeClass( "ui-state-active ui-corner-top" ) .addClass( "ui-state-default ui-corner-all" ) .children( ".ui-icon" ) @@ -357,21 +368,6 @@ $.widget( "ui.accordion", { .addClass( "ui-accordion-content-active" ); } - // find elements to show and hide - var toShow = clicked.next(), - toHide = this.active.next(), - data = { - options: options, - newHeader: clickedIsActive && options.collapsible ? $([]) : clicked, - oldHeader: this.active, - newContent: clickedIsActive && options.collapsible ? $([]) : toShow, - oldContent: toHide - }, - down = this.headers.index( this.active[0] ) > this.headers.index( clicked[0] ); - - this.active = clickedIsActive ? $([]) : clicked; - this._toggle( toShow, toHide, data, clickedIsActive, down ); - return; }, @@ -405,7 +401,7 @@ $.widget( "ui.accordion", { toHide: toHide, complete: complete, down: down, - autoHeight: options.heightStyle !== "content" + autoHeight: options.autoHeight || options.fillSpace }; } else { animOptions = { @@ -413,7 +409,7 @@ $.widget( "ui.accordion", { toHide: toHide, complete: complete, down: down, - autoHeight: options.heightStyle !== "content" + autoHeight: options.autoHeight || options.fillSpace }; } @@ -482,7 +478,7 @@ $.widget( "ui.accordion", { return; } - if ( this.options.heightStyle === "content" ) { + if ( this.options.clearStyle ) { this.toShow.add( this.toHide ).css({ height: "", overflow: "" @@ -491,6 +487,10 @@ $.widget( "ui.accordion", { // other classes are removed before the animation; this one needs to stay until completed this.toHide.removeClass( "ui-accordion-content-active" ); + // Work around for rendering bug in IE (#5421) + if ( this.toHide.length ) { + this.toHide.parent()[0].className = this.toHide.parent()[0].className; + } this._trigger( "change", null, this.data ); } @@ -599,7 +599,7 @@ $.extend( $.ui.accordion, { return this.href.toLowerCase() === location.href.toLowerCase(); } }); - + var _create = prototype._create; prototype._create = function() { if ( this.options.navigation ) { @@ -621,48 +621,6 @@ $.extend( $.ui.accordion, { } _create.call( this ); }; -}( jQuery, jQuery.ui.accordion.prototype ) ); - -(function( $, prototype ) { - $.extend( prototype.options, { - autoHeight: true, // use heightStyle: "auto" - clearStyle: false, // use heightStyle: "content" - fillSpace: false // use heightStyle: "fill" - }); - - var _create = prototype._create, - _setOption = prototype._setOption; - - $.extend( prototype, { - _create: function() { - this.options.heightStyle = this.options.heightStyle || - this._mergeHeightStyle(); - _create.call( this ); - }, - - _setOption: function( key, value ) { - if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) { - this.options.heightStyle = this._mergeHeightStyle(); - } - _setOption.apply( this, arguments ); - }, - - _mergeHeightStyle: function() { - var options = this.options; - - if ( options.fillSpace ) { - return "fill"; - } - - if ( options.clearStyle ) { - return "content"; - } - - if ( options.autoHeight ) { - return "auto"; - } - } - }); -}( jQuery, jQuery.ui.accordion.prototype ) ); +}( jQuery, jQuery.ui.accordion.prototype )); })( jQuery ); diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index f48dc032afd..98950a0d4a9 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -1,7 +1,7 @@ /* * jQuery UI Autocomplete @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -11,10 +11,12 @@ * jquery.ui.core.js * jquery.ui.widget.js * jquery.ui.position.js - * jquery.ui.menu.js */ (function( $, undefined ) { +// used to prevent race conditions with remote data sources +var requestIndex = 0; + $.widget( "ui.autocomplete", { options: { appendTo: "body", @@ -32,9 +34,7 @@ $.widget( "ui.autocomplete", { _create: function() { var self = this, - doc = this.element[ 0 ].ownerDocument, - suppressKeyPress; - + doc = this.element[ 0 ].ownerDocument; this.element .addClass( "ui-autocomplete-input" ) .attr( "autocomplete", "off" ) @@ -45,11 +45,10 @@ $.widget( "ui.autocomplete", { "aria-haspopup": "true" }) .bind( "keydown.autocomplete", function( event ) { - if ( self.options.disabled || self.element.attr( "readonly" ) ) { + if ( self.options.disabled ) { return; } - suppressKeyPress = false; var keyCode = $.ui.keyCode; switch( event.keyCode ) { case keyCode.PAGE_UP: @@ -72,9 +71,6 @@ $.widget( "ui.autocomplete", { case keyCode.NUMPAD_ENTER: // when menu is open and has focus if ( self.menu.active ) { - // #6055 - Opera still allows the keypress to occur - // which causes forms to submit - suppressKeyPress = true; event.preventDefault(); } //passthrough - ENTER and TAB both select the current element @@ -101,12 +97,6 @@ $.widget( "ui.autocomplete", { break; } }) - .bind( "keypress.autocomplete", function( event ) { - if ( suppressKeyPress ) { - suppressKeyPress = false; - event.preventDefault(); - } - }) .bind( "focus.autocomplete", function() { if ( self.options.disabled ) { return; @@ -159,18 +149,16 @@ $.widget( "ui.autocomplete", { }, 13); }) .menu({ - // custom key handling for now - input: $(), focus: function( event, ui ) { var item = ui.item.data( "item.autocomplete" ); - if ( false !== self._trigger( "focus", event, { item: item } ) ) { + if ( false !== self._trigger( "focus", null, { item: item } ) ) { // use value to match what will end up in the input, if it was a key event if ( /^key/.test(event.originalEvent.type) ) { self.element.val( item.value ); } } }, - select: function( event, ui ) { + selected: function( event, ui ) { var item = ui.item.data( "item.autocomplete" ), previous = self.previous; @@ -257,17 +245,16 @@ $.widget( "ui.autocomplete", { url: url, data: request, dataType: "json", - success: function( data, status, xhr ) { - if ( xhr === self.xhr ) { + autocompleteRequest: ++requestIndex, + success: function( data, status ) { + if ( this.autocompleteRequest === requestIndex ) { response( data ); } - self.xhr = null; }, - error: function( xhr ) { - if ( xhr === self.xhr ) { + error: function() { + if ( this.autocompleteRequest === requestIndex ) { response( [] ); } - self.xhr = null; } }); }; @@ -287,7 +274,7 @@ $.widget( "ui.autocomplete", { } clearTimeout( this.closing ); - if ( this._trigger( "search", event ) === false ) { + if ( this._trigger("search") === false ) { return; } @@ -420,3 +407,187 @@ $.extend( $.ui.autocomplete, { }); }( jQuery )); + +/* + * jQuery UI Menu (not officially released) + * + * This widget isn't yet finished and the API is subject to change. We plan to finish + * it for the next release. You're welcome to give it a try anyway and give us feedback, + * as long as you're okay with migrating your code later on. We can help with that, too. + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function($) { + +$.widget("ui.menu", { + _create: function() { + var self = this; + this.element + .addClass("ui-menu ui-widget ui-widget-content ui-corner-all") + .attr({ + role: "listbox", + "aria-activedescendant": "ui-active-menuitem" + }) + .click(function( event ) { + if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { + return; + } + // temporary + event.preventDefault(); + self.select( event ); + }); + this.refresh(); + }, + + refresh: function() { + var self = this; + + // don't refresh list items that are already adapted + var items = this.element.children("li:not(.ui-menu-item):has(a)") + .addClass("ui-menu-item") + .attr("role", "menuitem"); + + items.children("a") + .addClass("ui-corner-all") + .attr("tabindex", -1) + // mouseenter doesn't work with event delegation + .mouseenter(function( event ) { + self.activate( event, $(this).parent() ); + }) + .mouseleave(function() { + self.deactivate(); + }); + }, + + activate: function( event, item ) { + this.deactivate(); + if (this.hasScroll()) { + var offset = item.offset().top - this.element.offset().top, + scroll = this.element.attr("scrollTop"), + elementHeight = this.element.height(); + if (offset < 0) { + this.element.attr("scrollTop", scroll + offset); + } else if (offset >= elementHeight) { + this.element.attr("scrollTop", scroll + offset - elementHeight + item.height()); + } + } + this.active = item.eq(0) + .children("a") + .addClass("ui-state-hover") + .attr("id", "ui-active-menuitem") + .end(); + this._trigger("focus", event, { item: item }); + }, + + deactivate: function() { + if (!this.active) { return; } + + this.active.children("a") + .removeClass("ui-state-hover") + .removeAttr("id"); + this._trigger("blur"); + this.active = null; + }, + + next: function(event) { + this.move("next", ".ui-menu-item:first", event); + }, + + previous: function(event) { + this.move("prev", ".ui-menu-item:last", event); + }, + + first: function() { + return this.active && !this.active.prevAll(".ui-menu-item").length; + }, + + last: function() { + return this.active && !this.active.nextAll(".ui-menu-item").length; + }, + + move: function(direction, edge, event) { + if (!this.active) { + this.activate(event, this.element.children(edge)); + return; + } + var next = this.active[direction + "All"](".ui-menu-item").eq(0); + if (next.length) { + this.activate(event, next); + } else { + this.activate(event, this.element.children(edge)); + } + }, + + // TODO merge with previousPage + nextPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.last()) { + this.activate(event, this.element.children(".ui-menu-item:first")); + return; + } + var base = this.active.offset().top, + height = this.element.height(), + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base - height + $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:last"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.last() ? ":first" : ":last")); + } + }, + + // TODO merge with nextPage + previousPage: function(event) { + if (this.hasScroll()) { + // TODO merge with no-scroll-else + if (!this.active || this.first()) { + this.activate(event, this.element.children(".ui-menu-item:last")); + return; + } + + var base = this.active.offset().top, + height = this.element.height(); + result = this.element.children(".ui-menu-item").filter(function() { + var close = $(this).offset().top - base + height - $(this).height(); + // TODO improve approximation + return close < 10 && close > -10; + }); + + // TODO try to catch this earlier when scrollTop indicates the last page anyway + if (!result.length) { + result = this.element.children(".ui-menu-item:first"); + } + this.activate(event, result); + } else { + this.activate(event, this.element.children(".ui-menu-item") + .filter(!this.active || this.first() ? ":last" : ":first")); + } + }, + + hasScroll: function() { + return this.element.height() < this.element.attr("scrollHeight"); + }, + + select: function( event ) { + this._trigger("selected", event, { item: this.active }); + } +}); + +}(jQuery)); diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index 78134e30866..27696e04bb9 100644 --- a/ui/jquery.ui.button.js +++ b/ui/jquery.ui.button.js @@ -1,7 +1,7 @@ /* * jQuery UI Button @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -290,27 +290,32 @@ $.widget( "ui.button", { .appendTo( buttonElement.empty() ) .text(), icons = this.options.icons, - multipleIcons = icons.primary && icons.secondary; + multipleIcons = icons.primary && icons.secondary, + buttonClasses = []; + if ( icons.primary || icons.secondary ) { - buttonElement.addClass( "ui-button-text-icon" + - ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + buttonClasses.push( "ui-button-text-icon" + ( multipleIcons ? "s" : ( icons.primary ? "-primary" : "-secondary" ) ) ); + if ( icons.primary ) { buttonElement.prepend( "" ); } + if ( icons.secondary ) { buttonElement.append( "" ); } + if ( !this.options.text ) { - buttonElement - .addClass( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ) - .removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" ); + buttonClasses.push( multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only" ); + buttonElement.removeClass( "ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary" ); + if ( !this.hasTitle ) { buttonElement.attr( "title", buttonText ); } } } else { - buttonElement.addClass( "ui-button-text-only" ); + buttonClasses.push( "ui-button-text-only" ); } + buttonElement.addClass( buttonClasses.join( " " ) ); } }); @@ -321,6 +326,7 @@ $.widget( "ui.buttonset", { _create: function() { this.element.addClass( "ui-buttonset" ); + this._init(); }, _init: function() { diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index d41654b2957..a13bdc60156 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -1,7 +1,7 @@ /*! * jQuery UI @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -105,8 +105,8 @@ $.fn.extend({ // other browsers return a string // we ignore the case of nested elements with an explicit value of 0 //
    - value = parseInt( elem.css( "zIndex" ), 10 ); - if ( !isNaN( value ) && value !== 0 ) { + value = parseInt( elem.css( "zIndex" ) ); + if ( !isNaN( value ) && value != 0 ) { return value; } } @@ -116,9 +116,9 @@ $.fn.extend({ return 0; }, - + disableSelection: function() { - return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + + return this.bind( $.support.selectstart ? "selectstart" : "mousedown" + ".ui-disableSelection", function( event ) { event.preventDefault(); }); diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index abcb3706719..0bd51365106 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -1,7 +1,7 @@ /* * jQuery UI Datepicker @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -167,7 +167,7 @@ $.extend(Datepicker.prototype, { /* Create a new instance object. */ _newInst: function(target, inline) { - var id = target[0].id.replace(/([^A-Za-z0-9_-])/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 @@ -700,7 +700,9 @@ $.extend(Datepicker.prototype, { inst.dpDiv[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('ui-datepicker-rtl'); if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && - inst.input.is(':visible') && !inst.input.is(':disabled')) + // #6694 - don't focus the input if it's already focused + // this breaks the change event in IE + inst.input.is(':visible') && !inst.input.is(':disabled') && inst.input[0] != document.activeElement) inst.input.focus(); // deffered render of the years select (to avoid flashes on Firefox) if( inst.yearshtml ){ @@ -752,7 +754,7 @@ $.extend(Datepicker.prototype, { _findPos: function(obj) { var inst = this._getInst(obj); var isRTL = this._get(inst, 'isRTL'); - while (obj && (obj.type == 'hidden' || obj.nodeType != 1)) { + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; } var position = $(obj).offset(); @@ -966,6 +968,8 @@ $.extend(Datepicker.prototype, { if (value == '') return null; var shortYearCutoff = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff; + shortYearCutoff = (typeof shortYearCutoff != 'string' ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); var dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort; var dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames; var monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort; @@ -1652,7 +1656,7 @@ $.extend(Datepicker.prototype, { /* Find the number of days in a given month. */ _getDaysInMonth: function(year, month) { - return 32 - new Date(year, month, 32).getDate(); + return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); }, /* Find the day of the week of the first of a month. */ @@ -1722,7 +1726,12 @@ function isArray(a) { Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function(options){ - + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick). diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 501772eb57b..c403354b2bd 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -1,7 +1,7 @@ /* * jQuery UI Dialog @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -18,7 +18,11 @@ */ (function( $, undefined ) { -var uiDialogClasses = "ui-dialog ui-widget ui-widget-content ui-corner-all ", +var uiDialogClasses = + 'ui-dialog ' + + 'ui-widget ' + + 'ui-widget-content ' + + 'ui-corner-all ', sizeRelatedOptions = { buttons: true, height: true, @@ -40,39 +44,39 @@ $.widget("ui.dialog", { autoOpen: true, buttons: {}, closeOnEscape: true, - closeText: "close", - dialogClass: "", + closeText: 'close', + dialogClass: '', draggable: true, hide: null, - height: "auto", + height: 'auto', maxHeight: false, maxWidth: false, minHeight: 150, minWidth: 150, modal: false, position: { - my: "center", - at: "center", + my: 'center', + at: 'center', of: window, - collision: "fit", + collision: 'fit', // ensure that the titlebar is never outside the document - using: function( pos ) { - var topOffset = $( this ).css( pos ).offset().top; - if ( topOffset < 0 ) { - $( this ).css( "top", pos.top - topOffset ); + using: function(pos) { + var topOffset = $(this).css(pos).offset().top; + if (topOffset < 0) { + $(this).css('top', pos.top - topOffset); } } }, resizable: true, show: null, stack: true, - title: "", + title: '', width: 300, zIndex: 1000 }, _create: function() { - this.originalTitle = this.element.attr( "title" ); + this.originalTitle = this.element.attr('title'); // #5742 - .attr() might return a DOMElement if ( typeof this.originalTitle !== "string" ) { this.originalTitle = ""; @@ -82,93 +86,104 @@ $.widget("ui.dialog", { var self = this, options = self.options, - title = options.title || " ", - titleId = $.ui.dialog.getTitleId( self.element ), + title = options.title || ' ', + titleId = $.ui.dialog.getTitleId(self.element), - uiDialog = ( self.uiDialog = $( "
    " ) ) - .appendTo( document.body ) + uiDialog = (self.uiDialog = $('
    ')) + .appendTo("body") .hide() - .addClass( uiDialogClasses + options.dialogClass ) + .addClass(uiDialogClasses + options.dialogClass) .css({ zIndex: options.zIndex }) // setting tabIndex makes the div focusable - .attr( "tabIndex", -1) - // TODO: move to stylesheet - .css( "outline", 0 ) - .keydown(function( event ) { - if ( options.closeOnEscape && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { - self.close( event ); + // setting outline to 0 prevents a border on focus in Mozilla + .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { + if (options.closeOnEscape && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { + + self.close(event); event.preventDefault(); } }) .attr({ - role: "dialog", - "aria-labelledby": titleId + role: 'dialog', + 'aria-labelledby': titleId }) - .mousedown(function( event ) { - self.moveToTop( false, event ); + .mousedown(function(event) { + self.moveToTop(false, event); }), uiDialogContent = self.element .show() - .removeAttr( "title" ) - .addClass( "ui-dialog-content ui-widget-content" ) - .appendTo( uiDialog ), - - uiDialogTitlebar = ( self.uiDialogTitlebar = $( "
    " ) ) - .addClass( "ui-dialog-titlebar ui-widget-header " + - "ui-corner-all ui-helper-clearfix" ) - .prependTo( uiDialog ), - - uiDialogTitlebarClose = $( "" ) - .addClass( "ui-dialog-titlebar-close ui-corner-all" ) - .attr( "role", "button" ) + .removeAttr('title') + .addClass( + 'ui-dialog-content ' + + 'ui-widget-content') + .appendTo(uiDialog), + + uiDialogTitlebar = (self.uiDialogTitlebar = $('
    ')) + .addClass( + 'ui-dialog-titlebar ' + + 'ui-widget-header ' + + 'ui-corner-all ' + + 'ui-helper-clearfix' + ) + .prependTo(uiDialog), + + uiDialogTitlebarClose = $('
    ') + .addClass( + 'ui-dialog-titlebar-close ' + + 'ui-corner-all' + ) + .attr('role', 'button') .hover( function() { - uiDialogTitlebarClose.addClass( "ui-state-hover" ); + uiDialogTitlebarClose.addClass('ui-state-hover'); }, function() { - uiDialogTitlebarClose.removeClass( "ui-state-hover" ); + uiDialogTitlebarClose.removeClass('ui-state-hover'); } ) .focus(function() { - uiDialogTitlebarClose.addClass( "ui-state-focus" ); + uiDialogTitlebarClose.addClass('ui-state-focus'); }) .blur(function() { - uiDialogTitlebarClose.removeClass( "ui-state-focus" ); + uiDialogTitlebarClose.removeClass('ui-state-focus'); }) - .click(function( event ) { - event.preventDefault(); - self.close( event ); + .click(function(event) { + self.close(event); + return false; }) - .appendTo( uiDialogTitlebar ), + .appendTo(uiDialogTitlebar), - uiDialogTitlebarCloseText = ( self.uiDialogTitlebarCloseText = $( "" ) ) - .addClass( "ui-icon ui-icon-closethick" ) - .text( options.closeText ) - .appendTo( uiDialogTitlebarClose ), + uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('')) + .addClass( + 'ui-icon ' + + 'ui-icon-closethick' + ) + .text(options.closeText) + .appendTo(uiDialogTitlebarClose), - uiDialogTitle = $( "" ) - .addClass( "ui-dialog-title" ) - .attr( "id", titleId ) - .html( title ) - .prependTo( uiDialogTitlebar ); + uiDialogTitle = $('') + .addClass('ui-dialog-title') + .attr('id', titleId) + .html(title) + .prependTo(uiDialogTitlebar); - uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); + uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); - if ( options.draggable && $.fn.draggable ) { + if (options.draggable && $.fn.draggable) { self._makeDraggable(); } - if ( options.resizable && $.fn.resizable ) { + if (options.resizable && $.fn.resizable) { self._makeResizable(); } - self._createButtons( options.buttons ); + self._createButtons(options.buttons); self._isOpen = false; - if ( $.fn.bgiframe ) { + if ($.fn.bgiframe) { uiDialog.bgiframe(); } }, @@ -182,21 +197,21 @@ $.widget("ui.dialog", { destroy: function() { var self = this; - if ( self.overlay ) { + if (self.overlay) { self.overlay.destroy(); } self.uiDialog.hide(); self.element - .removeClass( "ui-dialog-content ui-widget-content" ) - .hide() - .appendTo( "body" ); + .unbind('.dialog') + .removeData('dialog') + .removeClass('ui-dialog-content ui-widget-content') + .hide().appendTo(document.forms[0]); self.uiDialog.remove(); - if ( self.originalTitle ) { - self.element.attr( "title", self.originalTitle ); + if (self.originalTitle) { + self.element.attr('title', self.originalTitle); } - $.Widget.prototype.destroy.call( this ); return self; }, @@ -204,45 +219,49 @@ $.widget("ui.dialog", { return this.uiDialog; }, - close: function( event ) { + close: function(event) { var self = this, maxZ, thisZ; - if ( false === self._trigger( "beforeClose", event ) ) { + if (false === self._trigger('beforeClose', event)) { return; } - if ( self.overlay ) { + if (self.overlay) { self.overlay.destroy(); } - self.uiDialog.unbind( "keypress.ui-dialog" ); + self.uiDialog.unbind('keypress.ui-dialog'); self._isOpen = false; - if ( self.options.hide ) { - self.uiDialog.hide( self.options.hide, function() { - self._trigger( "close", event ); + if (self.options.hide) { + self.uiDialog.hide(self.options.hide, function() { + self._trigger('close', event); }); } else { self.uiDialog.hide(); - self._trigger( "close", event ); + self._trigger('close', event); } $.ui.dialog.overlay.resize(); // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) - if ( self.options.modal ) { + if (self.options.modal) { maxZ = 0; - $( ".ui-dialog" ).each(function() { - if ( this !== self.uiDialog[0] ) { - thisZ = $( this ).css( "z-index" ); - if ( !isNaN( thisZ ) ) { - maxZ = Math.max( maxZ, thisZ ); + $('.ui-dialog').each(function() { + if (this !== self.uiDialog[0]) { + thisZ = $(this).css('z-index'); + if(!isNaN(thisZ)) { + maxZ = Math.max(maxZ, thisZ); } } }); $.ui.dialog.maxZ = maxZ; } + + if ( $(".ui-dialog:visible").not(self.uiDialog).length === 0) { + $(document.body).css("overflow","auto"); + } return self; }, @@ -253,71 +272,69 @@ $.widget("ui.dialog", { // the force parameter allows us to move modal dialogs to their correct // position on open - moveToTop: function( force, event ) { + moveToTop: function(force, event) { var self = this, options = self.options, saveScroll; - if ( ( options.modal && !force ) || - ( !options.stack && !options.modal ) ) { - return self._trigger( "focus", event ); + if ((options.modal && !force) || + (!options.stack && !options.modal)) { + return self._trigger('focus', event); } - if ( options.zIndex > $.ui.dialog.maxZ ) { + if (options.zIndex > $.ui.dialog.maxZ) { $.ui.dialog.maxZ = options.zIndex; } - if ( self.overlay ) { + if (self.overlay) { $.ui.dialog.maxZ += 1; - $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; - self.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); + self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ); } - // Save and then restore scroll - // Opera 9.5+ resets when parent z-index is changed. - // http://bugs.jqueryui.com/ticket/3193 - saveScroll = { - scrollTop: self.element.attr( "scrollTop" ), - scrollLeft: self.element.attr( "scrollLeft" ) - }; + //Save and then restore scroll since Opera 9.5+ resets when parent z-Index is changed. + // http://ui.jquery.com/bugs/ticket/3193 + saveScroll = { scrollTop: self.element.attr('scrollTop'), scrollLeft: self.element.attr('scrollLeft') }; $.ui.dialog.maxZ += 1; - self.uiDialog.css( "z-index", $.ui.dialog.maxZ ); - self.element.attr( saveScroll ); - self._trigger( "focus", event ); + self.uiDialog.css('z-index', $.ui.dialog.maxZ); + self.element.attr(saveScroll); + self._trigger('focus', event); return self; }, open: function() { - if ( this._isOpen ) { - return; - } + if (this._isOpen) { return; } + + $(document.body).css("overflow","hidden"); var self = this, options = self.options, uiDialog = self.uiDialog; - self.overlay = options.modal ? new $.ui.dialog.overlay( self ) : null; + self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null; + if (uiDialog.next().length) { + uiDialog.appendTo(document.forms[0]); + } self._size(); - self._position( options.position ); - uiDialog.show( options.show ); - self.moveToTop( true ); + self._position(options.position); + uiDialog.show(options.show); + self.moveToTop(true); // prevent tabbing out of modal dialogs - if ( options.modal ) { - uiDialog.bind( "keypress.ui-dialog", function( event ) { - if ( event.keyCode !== $.ui.keyCode.TAB ) { + if (options.modal) { + uiDialog.bind('keypress.ui-dialog', function(event) { + if (event.keyCode !== $.ui.keyCode.TAB) { return; } - var tabbables = $( ":tabbable", this ), - first = tabbables.filter( ":first" ), - last = tabbables.filter( ":last" ); + var tabbables = $(':tabbable', this), + first = tabbables.filter(':first'), + last = tabbables.filter(':last'); - if ( event.target === last[0] && !event.shiftKey ) { - first.focus( 1 ); + if (event.target === last[0] && !event.shiftKey) { + first.focus(1); return false; - } else if ( event.target === first[0] && event.shiftKey ) { - last.focus( 1 ); + } else if (event.target === first[0] && event.shiftKey) { + last.focus(1); return false; } }); @@ -325,60 +342,63 @@ $.widget("ui.dialog", { // set focus to the first tabbable element in the content area or the first button // if there are no tabbable elements, set focus on the dialog itself - $( self.element.find( ":tabbable" ).get().concat( - uiDialog.find( ".ui-dialog-buttonpane :tabbable" ).get().concat( - uiDialog.get() ) ) ).eq( 0 ).focus(); + $(self.element.find(':tabbable').get().concat( + uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat( + uiDialog.get()))).eq(0).focus(); self._isOpen = true; - self._trigger( "open" ); + self._trigger('open'); return self; }, - _createButtons: function( buttons ) { + _createButtons: function(buttons) { var self = this, hasButtons = false, - uiDialogButtonPane = $( "
    " ) - .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ), - uiButtonSet = $( "
    " ) + uiDialogButtonPane = $('
    ') + .addClass( + 'ui-dialog-buttonpane ' + + 'ui-widget-content ' + + 'ui-helper-clearfix' + ), + uiButtonSet = $( "
    " ) .addClass( "ui-dialog-buttonset" ) .appendTo( uiDialogButtonPane ); // if we already have a button pane, remove it - self.uiDialog.find( ".ui-dialog-buttonpane" ).remove(); + self.uiDialog.find('.ui-dialog-buttonpane').remove(); - if ( typeof buttons === "object" && buttons !== null ) { - $.each( buttons, function() { + if (typeof buttons === 'object' && buttons !== null) { + $.each(buttons, function() { return !(hasButtons = true); }); } - if ( hasButtons ) { - $.each( buttons, function( name, props ) { + if (hasButtons) { + $.each(buttons, function(name, props) { props = $.isFunction( props ) ? { click: props, text: name } : props; - var button = $( "', props) + .unbind('click') .click(function() { - props.click.apply( self.element[0], arguments ); + props.click.apply(self.element[0], arguments); }) - .appendTo( uiButtonSet ); - if ( $.fn.button ) { + .appendTo(uiButtonSet); + if ($.fn.button) { button.button(); } }); - uiDialogButtonPane.appendTo( self.uiDialog ); + uiDialogButtonPane.appendTo(self.uiDialog); } }, _makeDraggable: function() { var self = this, options = self.options, - doc = $( document ), + doc = $(document), heightBeforeDrag; - function filteredUi( ui ) { + function filteredUi(ui) { return { position: ui.position, offset: ui.offset @@ -386,45 +406,40 @@ $.widget("ui.dialog", { } self.uiDialog.draggable({ - cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", - handle: ".ui-dialog-titlebar", - containment: "document", - start: function( event, ui ) { - heightBeforeDrag = options.height === "auto" ? "auto" : $( this ).height(); - $( this ) - .height( $( this ).height() ) - .addClass( "ui-dialog-dragging" ); - self._trigger( "dragStart", event, filteredUi( ui ) ); + cancel: '.ui-dialog-content, .ui-dialog-titlebar-close', + handle: '.ui-dialog-titlebar', + containment: 'document', + start: function(event, ui) { + heightBeforeDrag = options.height === "auto" ? "auto" : $(this).height(); + $(this).height($(this).height()).addClass("ui-dialog-dragging"); + self._trigger('dragStart', event, filteredUi(ui)); }, - drag: function( event, ui ) { - self._trigger( "drag", event, filteredUi( ui ) ); + drag: function(event, ui) { + self._trigger('drag', event, filteredUi(ui)); }, - stop: function( event, ui ) { - options.position = [ - ui.position.left - doc.scrollLeft(), - ui.position.top - doc.scrollTop() - ]; - $( this ) - .removeClass( "ui-dialog-dragging" ) - .height( heightBeforeDrag ); - self._trigger( "dragStop", event, filteredUi( ui ) ); + stop: function(event, ui) { + options.position = [ui.position.left - doc.scrollLeft(), + ui.position.top - doc.scrollTop()]; + $(this).removeClass("ui-dialog-dragging").height(heightBeforeDrag); + self._trigger('dragStop', event, filteredUi(ui)); $.ui.dialog.overlay.resize(); } }); }, - _makeResizable: function( handles ) { + _makeResizable: function(handles) { handles = (handles === undefined ? this.options.resizable : handles); var self = this, options = self.options, // .ui-resizable has position: relative defined in the stylesheet // but dialogs have to use absolute or fixed positioning - position = self.uiDialog.css( "position" ), - resizeHandles = typeof handles === 'string' ? + position = self.uiDialog.css('position'), + resizeHandles = (typeof handles === 'string' ? handles : - "n,e,s,w,se,sw,ne,nw"; + 'n,e,s,w,se,sw,ne,nw' + ); - function filteredUi( ui ) { + function filteredUi(ui) { return { originalPosition: ui.originalPosition, originalSize: ui.originalSize, @@ -434,86 +449,85 @@ $.widget("ui.dialog", { } self.uiDialog.resizable({ - cancel: ".ui-dialog-content", - containment: "document", + cancel: '.ui-dialog-content', + containment: 'document', alsoResize: self.element, maxWidth: options.maxWidth, maxHeight: options.maxHeight, minWidth: options.minWidth, minHeight: self._minHeight(), handles: resizeHandles, - start: function( event, ui ) { - $( this ).addClass( "ui-dialog-resizing" ); - self._trigger( "resizeStart", event, filteredUi( ui ) ); + start: function(event, ui) { + $(this).addClass("ui-dialog-resizing"); + self._trigger('resizeStart', event, filteredUi(ui)); }, - resize: function( event, ui ) { - self._trigger( "resize", event, filteredUi( ui ) ); + resize: function(event, ui) { + self._trigger('resize', event, filteredUi(ui)); }, - stop: function( event, ui ) { - $( this ).removeClass( "ui-dialog-resizing" ); - options.height = $( this ).height(); - options.width = $( this ).width(); - self._trigger( "resizeStop", event, filteredUi( ui ) ); + stop: function(event, ui) { + $(this).removeClass("ui-dialog-resizing"); + options.height = $(this).height(); + options.width = $(this).width(); + self._trigger('resizeStop', event, filteredUi(ui)); $.ui.dialog.overlay.resize(); } }) - .css( "position", position ) - .find( ".ui-resizable-se" ) - .addClass( "ui-icon ui-icon-grip-diagonal-se" ); + .css('position', position) + .find('.ui-resizable-se').addClass('ui-icon ui-icon-grip-diagonal-se'); }, _minHeight: function() { var options = this.options; - if ( options.height === "auto" ) { + if (options.height === 'auto') { return options.minHeight; } else { - return Math.min( options.minHeight, options.height ); + return Math.min(options.minHeight, options.height); } }, - _position: function( position ) { + _position: function(position) { var myAt = [], - offset = [ 0, 0 ], + offset = [0, 0], isVisible; - if ( position ) { + if (position) { // deep extending converts arrays to objects in jQuery <= 1.3.2 :-( // if (typeof position == 'string' || $.isArray(position)) { // myAt = $.isArray(position) ? position : position.split(' '); - if ( typeof position === "string" || (typeof position === "object" && "0" in position ) ) { - myAt = position.split ? position.split( " " ) : [ position[ 0 ], position[ 1 ] ]; - if ( myAt.length === 1 ) { - myAt[ 1 ] = myAt[ 0 ]; + if (typeof position === 'string' || (typeof position === 'object' && '0' in position)) { + myAt = position.split ? position.split(' ') : [position[0], position[1]]; + if (myAt.length === 1) { + myAt[1] = myAt[0]; } - $.each( [ "left", "top" ], function( i, offsetPosition ) { - if ( +myAt[ i ] === myAt[ i ] ) { - offset[ i ] = myAt[ i ]; - myAt[ i ] = offsetPosition; + $.each(['left', 'top'], function(i, offsetPosition) { + if (+myAt[i] === myAt[i]) { + offset[i] = myAt[i]; + myAt[i] = offsetPosition; } }); position = { - my: myAt.join( " " ), - at: myAt.join( " " ), - offset: offset.join( " " ) + my: myAt.join(" "), + at: myAt.join(" "), + offset: offset.join(" ") }; } - position = $.extend( {}, $.ui.dialog.prototype.options.position, position ); + position = $.extend({}, $.ui.dialog.prototype.options.position, position); } else { position = $.ui.dialog.prototype.options.position; } // need to show the dialog to get the actual offset in the position plugin - isVisible = this.uiDialog.is( ":visible" ); - if ( !isVisible ) { + isVisible = this.uiDialog.is(':visible'); + if (!isVisible) { this.uiDialog.show(); } - this.uiDialog.position( position ); - if ( !isVisible ) { + this.uiDialog.position(position); + if (!isVisible) { this.uiDialog.hide(); } }, @@ -542,28 +556,28 @@ $.widget("ui.dialog", { } }, - _setOption: function( key, value ) { + _setOption: function(key, value){ var self = this, uiDialog = self.uiDialog; - switch ( key ) { + switch (key) { case "buttons": - self._createButtons( value ); + self._createButtons(value); break; case "closeText": // ensure that we always pass a string - self.uiDialogTitlebarCloseText.text( "" + value ); + self.uiDialogTitlebarCloseText.text("" + value); break; case "dialogClass": uiDialog - .removeClass( self.options.dialogClass ) - .addClass( uiDialogClasses + value ); + .removeClass(self.options.dialogClass) + .addClass(uiDialogClasses + value); break; case "disabled": - if ( value ) { - uiDialog.addClass( "ui-dialog-disabled" ); + if (value) { + uiDialog.addClass('ui-dialog-disabled'); } else { - uiDialog.removeClass( "ui-dialog-disabled" ); + uiDialog.removeClass('ui-dialog-disabled'); } break; case "draggable": @@ -577,33 +591,32 @@ $.widget("ui.dialog", { } break; case "position": - self._position( value ); + self._position(value); break; case "resizable": // currently resizable, becoming non-resizable var isResizable = uiDialog.is( ":data(resizable)" ); - if ( isResizable && !value ) { - uiDialog.resizable( "destroy" ); + if (isResizable && !value) { + uiDialog.resizable('destroy'); } // currently resizable, changing handles - if ( isResizable && typeof value === "string" ) { - uiDialog.resizable( "option", "handles", value ); + if (isResizable && typeof value === 'string') { + uiDialog.resizable('option', 'handles', value); } // currently non-resizable, becoming resizable - if ( !isResizable && value !== false ) { - self._makeResizable( value ); + if (!isResizable && value !== false) { + self._makeResizable(value); } break; case "title": // convert whatever was passed in o a string, for html() to not throw up - $( ".ui-dialog-title", self.uiDialogTitlebar ) - .html( "" + ( value || " " ) ); + $(".ui-dialog-title", self.uiDialogTitlebar).html("" + (value || ' ')); break; } - $.Widget.prototype._setOption.apply( self, arguments ); + $.Widget.prototype._setOption.apply(self, arguments); }, _size: function() { @@ -616,20 +629,21 @@ $.widget("ui.dialog", { isVisible = this.uiDialog.is( ":visible" ); // reset content sizing - this.element.show().css({ - width: "auto", + // hide for non content measurement because height: 0 doesn't work in IE quirks mode (see #4350) + this.element.css({ + width: 'auto', minHeight: 0, height: 0 }); - if ( options.minWidth > options.width ) { + if (options.minWidth > options.width) { options.width = options.minWidth; } // reset wrapper sizing // determine the height of all the non-content elements nonContentHeight = this.uiDialog.css({ - height: "auto", + height: 'auto', width: options.width }) .height(); @@ -654,8 +668,19 @@ $.widget("ui.dialog", { this.element.height( Math.max( options.height - nonContentHeight, 0 ) ); } - if (this.uiDialog.is( ":data(resizable)" ) ) { - this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); + this.element + .css(options.height === 'auto' ? { + minHeight: Math.max(options.minHeight - nonContentHeight, 0), + height: $.support.minHeight ? 'auto' : + Math.max(options.minHeight - nonContentHeight, 0) + } : { + minHeight: 0, + height: Math.max(options.height - nonContentHeight, 0) + }) + .show(); + + if (this.uiDialog.is(':data(resizable)')) { + this.uiDialog.resizable('option', 'minHeight', this._minHeight()); } } }); @@ -667,93 +692,89 @@ $.extend($.ui.dialog, { maxZ: 0, getTitleId: function($el) { - var id = $el.attr( "id" ); - if ( !id ) { + var id = $el.attr('id'); + if (!id) { this.uuid += 1; id = this.uuid; } - return "ui-dialog-title-" + id; + return 'ui-dialog-title-' + id; }, - overlay: function( dialog ) { - this.$el = $.ui.dialog.overlay.create( dialog ); + overlay: function(dialog) { + this.$el = $.ui.dialog.overlay.create(dialog); } }); -$.extend( $.ui.dialog.overlay, { +$.extend($.ui.dialog.overlay, { instances: [], // reuse old instances due to IE memory leak with alpha transparency (see #5185) oldInstances: [], maxZ: 0, - events: $.map( - "focus,mousedown,mouseup,keydown,keypress,click".split( "," ), - function( event ) { - return event + ".dialog-overlay"; - } - ).join( " " ), - create: function( dialog ) { - if ( this.instances.length === 0 ) { + events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','), + function(event) { return event + '.dialog-overlay'; }).join(' '), + create: function(dialog) { + if (this.instances.length === 0) { // prevent use of anchors and inputs // we use a setTimeout in case the overlay is created from an // event that we're going to be cancelling (see #2804) setTimeout(function() { // handle $(el).dialog().dialog('close') (see #4065) - if ( $.ui.dialog.overlay.instances.length ) { - $( document ).bind( $.ui.dialog.overlay.events, function( event ) { + if ($.ui.dialog.overlay.instances.length) { + $(document).bind($.ui.dialog.overlay.events, function(event) { // stop events if the z-index of the target is < the z-index of the overlay // we cannot return true when we don't want to cancel the event (#3523) - if ( $( event.target ).zIndex() < $.ui.dialog.overlay.maxZ ) { + if ($(event.target).zIndex() < $.ui.dialog.overlay.maxZ) { return false; } }); } - }, 1 ); + }, 1); // allow closing by pressing the escape key - $( document ).bind( "keydown.dialog-overlay", function( event ) { - if ( dialog.options.closeOnEscape && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE ) { + $(document).bind('keydown.dialog-overlay', function(event) { + if (dialog.options.closeOnEscape && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE) { - dialog.close( event ); + dialog.close(event); event.preventDefault(); } }); // handle window resize - $( window ).bind( "resize.dialog-overlay", $.ui.dialog.overlay.resize ); + $(window).bind('resize.dialog-overlay', $.ui.dialog.overlay.resize); } - var $el = ( this.oldInstances.pop() || $( "
    " ).addClass( "ui-widget-overlay" ) ) - .appendTo( document.body ) + var $el = (this.oldInstances.pop() || $('
    ').addClass('ui-widget-overlay')) + .appendTo(document.body) .css({ width: this.width(), height: this.height() }); - if ( $.fn.bgiframe ) { + if ($.fn.bgiframe) { $el.bgiframe(); } - this.instances.push( $el ); + this.instances.push($el); return $el; }, - destroy: function( $el ) { - var indexOf = $.inArray( $el, this.instances ); - if ( indexOf !== -1 ) { - this.oldInstances.push( this.instances.splice( indexOf, 1 )[ 0 ] ); + destroy: function($el) { + var indexOf = $.inArray($el, this.instances); + if (indexOf != -1){ + this.oldInstances.push(this.instances.splice(indexOf, 1)[0]); } - if ( this.instances.length === 0 ) { - $( [ document, window ] ).unbind( ".dialog-overlay" ); + if (this.instances.length === 0) { + $([document, window]).unbind('.dialog-overlay'); } $el.remove(); - + // adjust the maxZ to allow other modal dialogs to continue to work (see #4309) var maxZ = 0; - $.each( this.instances, function() { - maxZ = Math.max( maxZ, this.css( "z-index" ) ); + $.each(this.instances, function() { + maxZ = Math.max(maxZ, this.css('z-index')); }); this.maxZ = maxZ; }, @@ -762,7 +783,7 @@ $.extend( $.ui.dialog.overlay, { var scrollHeight, offsetHeight; // handle IE 6 - if ( $.browser.msie && $.browser.version < 7 ) { + if ($.browser.msie && $.browser.version < 7) { scrollHeight = Math.max( document.documentElement.scrollHeight, document.body.scrollHeight @@ -772,14 +793,14 @@ $.extend( $.ui.dialog.overlay, { document.body.offsetHeight ); - if ( scrollHeight < offsetHeight ) { - return $( window ).height() + "px"; + if (scrollHeight < offsetHeight) { + return $(window).height() + 'px'; } else { - return scrollHeight + "px"; + return scrollHeight + 'px'; } // handle "good" browsers } else { - return $( document ).height() + "px"; + return $(document).height() + 'px'; } }, @@ -787,7 +808,7 @@ $.extend( $.ui.dialog.overlay, { var scrollWidth, offsetWidth; // handle IE 6 - if ( $.browser.msie && $.browser.version < 7 ) { + if ($.browser.msie && $.browser.version < 7) { scrollWidth = Math.max( document.documentElement.scrollWidth, document.body.scrollWidth @@ -797,14 +818,14 @@ $.extend( $.ui.dialog.overlay, { document.body.offsetWidth ); - if ( scrollWidth < offsetWidth ) { - return $( window ).width() + "px"; + if (scrollWidth < offsetWidth) { + return $(window).width() + 'px'; } else { - return scrollWidth + "px"; + return scrollWidth + 'px'; } // handle "good" browsers } else { - return $( document ).width() + "px"; + return $(document).width() + 'px'; } }, @@ -817,9 +838,9 @@ $.extend( $.ui.dialog.overlay, { * This is handled by shrinking the overlay before setting it * to the full document size. */ - var $overlays = $( [] ); - $.each( $.ui.dialog.overlay.instances, function() { - $overlays = $overlays.add( this ); + var $overlays = $([]); + $.each($.ui.dialog.overlay.instances, function() { + $overlays = $overlays.add(this); }); $overlays.css({ @@ -832,10 +853,10 @@ $.extend( $.ui.dialog.overlay, { } }); -$.extend( $.ui.dialog.overlay.prototype, { +$.extend($.ui.dialog.overlay.prototype, { destroy: function() { - $.ui.dialog.overlay.destroy( this.$el ); + $.ui.dialog.overlay.destroy(this.$el); } }); -}( jQuery ) ); +}(jQuery)); diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 2d4947145ca..be0a6459a69 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -1,7 +1,7 @@ /* * jQuery UI Draggable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -175,6 +175,10 @@ $.widget("ui.draggable", $.ui.mouse, { if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; if($.ui.ddmanager) $.ui.ddmanager.drag(this, event); + + if(this.options.gridCallback) { + this.options.gridCallback(); + } return false; }, @@ -192,8 +196,8 @@ $.widget("ui.draggable", $.ui.mouse, { this.dropped = false; } - //if the original element is removed, don't bother to continue - if(!this.element[0] || !this.element[0].parentNode) + //if the original element is removed, don't bother to continue if helper is set to "original" + if((!this.element[0] || !this.element[0].parentNode) && this.options.helper == "original") return false; if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) { diff --git a/ui/jquery.ui.droppable.js b/ui/jquery.ui.droppable.js index 084f845c786..decdc1712a8 100644 --- a/ui/jquery.ui.droppable.js +++ b/ui/jquery.ui.droppable.js @@ -1,7 +1,7 @@ /* * jQuery UI Droppable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js deleted file mode 100644 index 6381bedbc74..00000000000 --- a/ui/jquery.ui.menu.js +++ /dev/null @@ -1,249 +0,0 @@ -/* - * jQuery UI Menu @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function($) { - -var idIncrement = 0; - -$.widget("ui.menu", { - _create: function() { - var self = this; - this.menuId = this.element.attr( "id" ) || "ui-menu-" + idIncrement++; - this.element - .addClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .attr({ - id: this.menuId, - role: "listbox" - }) - .bind( "click.menu", function( event ) { - if ( self.options.disabled ) { - return false; - } - if ( !$( event.target ).closest( ".ui-menu-item a" ).length ) { - return; - } - // temporary - event.preventDefault(); - self.select( event ); - }) - .bind( "mouseover.menu", function( event ) { - if ( self.options.disabled ) { - return; - } - var target = $( event.target ).closest( ".ui-menu-item" ); - if ( target.length && target.parent()[0] === self.element[0] ) { - self.activate( event, target ); - } - }) - .bind("mouseout.menu", function( event ) { - if ( self.options.disabled ) { - return; - } - var target = $( event.target ).closest( ".ui-menu-item" ); - if ( target.length && target.parent()[0] === self.element[0] ) { - self.deactivate( event ); - } - }); - this.refresh(); - - if ( !this.options.input ) { - this.options.input = this.element.attr( "tabIndex", 0 ); - } - this.options.input.bind( "keydown.menu", function( event ) { - if ( self.options.disabled ) { - return; - } - switch ( event.keyCode ) { - case $.ui.keyCode.PAGE_UP: - self.previousPage(); - event.preventDefault(); - event.stopImmediatePropagation(); - break; - case $.ui.keyCode.PAGE_DOWN: - self.nextPage(); - event.preventDefault(); - event.stopImmediatePropagation(); - break; - case $.ui.keyCode.UP: - self.previous(); - event.preventDefault(); - event.stopImmediatePropagation(); - break; - case $.ui.keyCode.DOWN: - self.next(); - event.preventDefault(); - event.stopImmediatePropagation(); - break; - case $.ui.keyCode.ENTER: - self.select(); - event.preventDefault(); - event.stopImmediatePropagation(); - break; - } - }); - }, - - destroy: function() { - $.Widget.prototype.destroy.apply( this, arguments ); - - this.element - .removeClass( "ui-menu ui-widget ui-widget-content ui-corner-all" ) - .removeAttr( "tabIndex" ) - .removeAttr( "role" ) - .removeAttr( "aria-activedescendant" ); - - this.element.children( ".ui-menu-item" ) - .removeClass( "ui-menu-item" ) - .removeAttr( "role" ) - .children( "a" ) - .removeClass( "ui-corner-all" ) - .removeAttr( "tabIndex" ) - .unbind( ".menu" ); - }, - - refresh: function() { - // don't refresh list items that are already adapted - var items = this.element.children( "li:not(.ui-menu-item):has(a)" ) - .addClass( "ui-menu-item" ) - .attr( "role", "menuitem" ); - - items.children( "a" ) - .addClass( "ui-corner-all" ) - .attr( "tabIndex", -1 ); - }, - - activate: function( event, item ) { - var self = this; - this.deactivate(); - if ( this._hasScroll() ) { - var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true) ) || 0, - paddingtop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0, - offset = item.offset().top - this.element.offset().top - borderTop - paddingtop, - scroll = this.element.attr( "scrollTop" ), - elementHeight = this.element.height(), - itemHeight = item.height(); - if ( offset < 0 ) { - this.element.attr( "scrollTop", scroll + offset ); - } else if ( offset + itemHeight > elementHeight ) { - this.element.attr( "scrollTop", scroll + offset - elementHeight + itemHeight ); - } - } - this.active = item.first() - .children( "a" ) - .addClass( "ui-state-hover" ) - .attr( "id", function(index, id) { - return (self.itemId = id || self.menuId + "-activedescendant"); - }) - .end(); - // need to remove the attribute before adding it for the screenreader to pick up the change - // see http://groups.google.com/group/jquery-a11y/msg/929e0c1e8c5efc8f - this.element.removeAttr("aria-activedescenant").attr("aria-activedescenant", self.itemId); - this._trigger( "focus", event, { item: item } ); - }, - - deactivate: function(event) { - if (!this.active) { - return; - } - - var self = this; - this.active.children( "a" ).removeClass( "ui-state-hover" ); - // remove only generated id - $( "#" + self.menuId + "-activedescendant" ).removeAttr( "id" ); - this.element.removeAttr( "aria-activedescenant" ); - this._trigger( "blur", event ); - this.active = null; - }, - - next: function(event) { - this._move( "next", ".ui-menu-item", "first", event ); - }, - - previous: function(event) { - this._move( "prev", ".ui-menu-item", "last", event ); - }, - - first: function() { - return this.active && !this.active.prevAll( ".ui-menu-item" ).length; - }, - - last: function() { - return this.active && !this.active.nextAll( ".ui-menu-item" ).length; - }, - - _move: function(direction, edge, filter, event) { - if ( !this.active ) { - this.activate( event, this.element.children(edge)[filter]() ); - return; - } - var next = this.active[ direction + "All" ]( ".ui-menu-item" ).eq( 0 ); - if ( next.length ) { - this.activate( event, next ); - } else { - this.activate( event, this.element.children(edge)[filter]() ); - } - }, - - nextPage: function( event ) { - if ( this._hasScroll() ) { - if ( !this.active || this.last() ) { - this.activate( event, this.element.children( ".ui-menu-item" ).first() ); - return; - } - var base = this.active.offset().top, - height = this.element.height(), - result; - this.active.nextAll( ".ui-menu-item" ).each( function() { - result = $( this ); - return $( this ).offset().top - base - height < 0; - }); - - this.activate( event, result ); - } else { - this.activate( event, this.element.children( ".ui-menu-item" ) - [ !this.active || this.last() ? "first" : "last" ]() ); - } - }, - - previousPage: function( event ) { - if ( this._hasScroll() ) { - if ( !this.active || this.first() ) { - this.activate( event, this.element.children( ".ui-menu-item" ).last() ); - return; - } - - var base = this.active.offset().top, - height = this.element.height(), - result; - this.active.prevAll( ".ui-menu-item" ).each( function() { - result = $( this ); - return $(this).offset().top - base + height > 0; - }); - - this.activate( event, result ); - } else { - this.activate( event, this.element.children( ".ui-menu-item" ) - [ !this.active || this.first() ? ":last" : ":first" ]() ); - } - }, - - _hasScroll: function() { - return this.element.height() < this.element.attr( "scrollHeight" ); - }, - - select: function( event ) { - this._trigger( "select", event, { item: this.active } ); - } -}); - -}( jQuery )); diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index bfe8640a2a3..5d5dfa1811e 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -1,7 +1,7 @@ /*! * jQuery UI Mouse @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -86,14 +86,18 @@ $.widget("ui.mouse", { .bind('mousemove.'+this.widgetName, this._mouseMoveDelegate) .bind('mouseup.'+this.widgetName, this._mouseUpDelegate); - event.preventDefault(); + // preventDefault() is used to prevent the selection of text here - + // however, in Safari, this causes select boxes not to be selectable + // anymore, so this fix is needed + ($.browser.safari || event.preventDefault()); + event.originalEvent.mouseHandled = true; return true; }, _mouseMove: function(event) { // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + if ($.browser.msie && !event.button) { return this._mouseUp(event); } diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 3992e1c63a1..8bdc462dd59 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -1,7 +1,7 @@ /* * jQuery UI Position @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -82,7 +82,7 @@ $.fn.position = function( options ) { if ( options.at[0] === "right" ) { basePosition.left += targetWidth; - } else if (options.at[0] === center ) { + } else if ( options.at[0] === center ) { basePosition.left += targetWidth / 2; } @@ -102,9 +102,9 @@ $.fn.position = function( options ) { marginLeft = parseInt( $.curCSS( this, "marginLeft", true ) ) || 0, marginTop = parseInt( $.curCSS( this, "marginTop", true ) ) || 0, collisionWidth = elemWidth + marginLeft + - parseInt( $.curCSS( this, "marginRight", true ) ) || 0, + ( parseInt( $.curCSS( this, "marginRight", true ) ) || 0 ), collisionHeight = elemHeight + marginTop + - parseInt( $.curCSS( this, "marginBottom", true ) ) || 0, + ( parseInt( $.curCSS( this, "marginBottom", true ) ) || 0 ), position = $.extend( {}, basePosition ), collisionPosition; diff --git a/ui/jquery.ui.progressbar.js b/ui/jquery.ui.progressbar.js index 009049d275c..70c6e025c91 100644 --- a/ui/jquery.ui.progressbar.js +++ b/ui/jquery.ui.progressbar.js @@ -1,7 +1,7 @@ /* * jQuery UI Progressbar @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index a835ef9a869..1e1706a9dfd 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -1,7 +1,7 @@ /* * jQuery UI Resizable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -322,10 +322,10 @@ $.widget("ui.resizable", $.ui.mouse, { if(this._helper) { var pr = this._proportionallyResizeElements, ista = pr.length && (/textarea/i).test(pr[0].nodeName), - soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, - soffsetw = ista ? 0 : self.sizeDiff.width; + soffseth = ista && $.ui.hasScroll(pr[0], 'left') /* TODO - jump height */ ? 0 : self.sizeDiff.height, + soffsetw = ista ? 0 : self.sizeDiff.width; - var s = { width: (self.size.width - soffsetw), height: (self.size.height - soffseth) }, + var s = { width: (self.helper.width() - soffsetw), height: (self.helper.height() - soffseth) }, left = (parseInt(self.element.css('left'), 10) + (self.position.left - self.originalPosition.left)) || null, top = (parseInt(self.element.css('top'), 10) + (self.position.top - self.originalPosition.top)) || null; diff --git a/ui/jquery.ui.selectable.js b/ui/jquery.ui.selectable.js index e776e483ddc..fa7d011229c 100644 --- a/ui/jquery.ui.selectable.js +++ b/ui/jquery.ui.selectable.js @@ -1,7 +1,7 @@ /* * jQuery UI Selectable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js index d3b4744e3dc..f6bc570256f 100644 --- a/ui/jquery.ui.slider.js +++ b/ui/jquery.ui.slider.js @@ -1,7 +1,7 @@ /* * jQuery UI Slider @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 32757d41c4b..7f9de5b264f 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -1,7 +1,7 @@ /* * jQuery UI Sortable @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -77,7 +77,8 @@ $.widget("ui.sortable", $.ui.mouse, { if ( key === "disabled" ) { this.options[ key ] = value; - this.widget().toggleClass( "ui-sortable-disabled", !!value ); + this.widget() + [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); } else { // Don't call widget base _setOption for disable as it adds ui-state-disabled class $.Widget.prototype._setOption.apply(this, arguments); @@ -359,7 +360,7 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.dragging) { - this._mouseUp(); + this._mouseUp({ target: null }); if(this.options.helper == "original") this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"); @@ -377,21 +378,23 @@ $.widget("ui.sortable", $.ui.mouse, { } - //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! - if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); - if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); - - $.extend(this, { - helper: null, - dragging: false, - reverting: false, - _noFinalSort: null - }); + if (this.placeholder) { + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node! + if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]); + if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove(); - if(this.domPosition.prev) { - $(this.domPosition.prev).after(this.currentItem); - } else { - $(this.domPosition.parent).prepend(this.currentItem); + $.extend(this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + }); + + if(this.domPosition.prev) { + $(this.domPosition.prev).after(this.currentItem); + } else { + $(this.domPosition.parent).prepend(this.currentItem); + } } return this; diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js deleted file mode 100644 index 39a498359cc..00000000000 --- a/ui/jquery.ui.spinner.js +++ /dev/null @@ -1,360 +0,0 @@ -/* - * jQuery UI Spinner @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Spinner - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function($) { - -$.widget('ui.spinner', { - options: { - incremental: true, - max: null, - min: null, - numberformat: null, - page: 10, - step: null, - value: null - }, - - _create: function() { - this._draw(); - this._markupOptions(); - this._mousewheel(); - this._aria(); - }, - - _markupOptions: function() { - var _this = this; - $.each({ - min: -Number.MAX_VALUE, - max: Number.MAX_VALUE, - step: 1 - }, function(attr, defaultValue) { - if (_this.options[attr] === null) { - var value = _this.element.attr(attr); - _this.options[attr] = typeof value == "string" && value.length > 0 ? _this._parse(value) : defaultValue; - } - }); - this.value(this.options.value !== null ? this.options.value : this.element.val() || 0); - }, - - _draw: function() { - var self = this, - options = self.options; - - var uiSpinner = this.uiSpinner = self.element - .addClass('ui-spinner-input') - .attr('autocomplete', 'off') - .wrap(self._uiSpinnerHtml()) - .parent() - // add buttons - .append(self._buttonHtml()) - // add behaviours - .hover(function() { - if (!options.disabled) { - $(this).addClass('ui-state-hover'); - } - self.hovered = true; - }, function() { - $(this).removeClass('ui-state-hover'); - self.hovered = false; - }); - - this.element - .bind('keydown.spinner', function(event) { - if (self.options.disabled) { - return; - } - if (self._start(event)) { - return self._keydown(event); - } - return true; - }) - .bind('keyup.spinner', function(event) { - if (self.options.disabled) { - return; - } - if (self.spinning) { - self._stop(event); - self._change(event); - } - }) - .bind('focus.spinner', function() { - uiSpinner.addClass('ui-state-active'); - self.focused = true; - }) - .bind('blur.spinner', function(event) { - self.value(self.element.val()); - if (!self.hovered) { - uiSpinner.removeClass('ui-state-active'); - } - self.focused = false; - }); - - // button bindings - this.buttons = uiSpinner.find('.ui-spinner-button') - .attr("tabIndex", -1) - .button() - .removeClass("ui-corner-all") - .bind('mousedown', function(event) { - if (self.options.disabled) { - return; - } - if (self._start(event) === false) { - return false; - } - self._repeat(null, $(this).hasClass('ui-spinner-up') ? 1 : -1, event); - }) - .bind('mouseup', function(event) { - if (self.options.disabled) { - return; - } - if (self.spinning) { - self._stop(event); - self._change(event); - } - }) - .bind("mouseenter", function() { - if (self.options.disabled) { - return; - } - // button will add ui-state-active if mouse was down while mouseleave and kept down - if ($(this).hasClass("ui-state-active")) { - if (self._start(event) === false) { - return false; - } - self._repeat(null, $(this).hasClass('ui-spinner-up') ? 1 : -1, event); - } - }) - .bind("mouseleave", function() { - if (self.spinning) { - self._stop(event); - self._change(event); - } - }); - - // disable spinner if element was already disabled - if (options.disabled) { - this.disable(); - } - }, - - _keydown: function(event) { - var o = this.options, - KEYS = $.ui.keyCode; - - switch (event.keyCode) { - case KEYS.UP: - this._repeat(null, 1, event); - return false; - case KEYS.DOWN: - this._repeat(null, -1, event); - return false; - case KEYS.PAGE_UP: - this._repeat(null, this.options.page, event); - return false; - case KEYS.PAGE_DOWN: - this._repeat(null, -this.options.page, event); - return false; - - case KEYS.ENTER: - this.value(this.element.val()); - } - - return true; - }, - - _mousewheel: function() { - // need the delta normalization that mousewheel plugin provides - if (!$.fn.mousewheel) { - return; - } - var self = this; - this.element.bind("mousewheel.spinner", function(event, delta) { - if (self.options.disabled) { - return; - } - if (!self.spinning && !self._start(event)) { - return false; - } - self._spin((delta > 0 ? 1 : -1) * self.options.step, event); - clearTimeout(self.timeout); - self.timeout = setTimeout(function() { - if (self.spinning) { - self._stop(event); - self._change(event); - } - }, 100); - event.preventDefault(); - }); - }, - - _uiSpinnerHtml: function() { - return ''; - }, - - _buttonHtml: function() { - return '' + - ''; - }, - - _start: function(event) { - if (!this.spinning && this._trigger('start', event) !== false) { - if (!this.counter) { - this.counter = 1; - } - this.spinning = true; - return true; - } - return false; - }, - - _repeat: function(i, steps, event) { - var self = this; - i = i || 500; - - clearTimeout(this.timer); - this.timer = setTimeout(function() { - self._repeat(40, steps, event); - }, i); - - self._spin(steps * self.options.step, event); - }, - - _spin: function(step, event) { - if (!this.counter) { - this.counter = 1; - } - - // TODO refactor, maybe figure out some non-linear math - var newVal = this.value() + step * (this.options.incremental && - this.counter > 20 - ? this.counter > 100 - ? this.counter > 200 - ? 100 - : 10 - : 2 - : 1); - - if (this._trigger('spin', event, { value: newVal }) !== false) { - this.value(newVal); - this.counter++; - } - }, - - _stop: function(event) { - this.counter = 0; - if (this.timer) { - window.clearTimeout(this.timer); - } - this.element[0].focus(); - this.spinning = false; - this._trigger('stop', event); - }, - - _change: function(event) { - this._trigger('change', event); - }, - - _setOption: function(key, value) { - if (key == 'value') { - value = this._parse(value); - if (value < this.options.min) { - value = this.options.min; - } - if (value > this.options.max) { - value = this.options.max; - } - } - if (key == 'disabled') { - if (value) { - this.element.attr("disabled", true); - this.buttons.button("disable"); - } else { - this.element.removeAttr("disabled"); - this.buttons.button("enable"); - } - } - $.Widget.prototype._setOption.call( this, key, value ); - }, - - _setOptions: function( options ) { - $.Widget.prototype._setOptions.call( this, options ); - if ( "value" in options ) { - this._format( this.options.value ); - } - this._aria(); - }, - - _aria: function() { - this.element - .attr('aria-valuemin', this.options.min) - .attr('aria-valuemax', this.options.max) - .attr('aria-valuenow', this.options.value); - }, - - _parse: function(val) { - var input = val; - if (typeof val == 'string') { - // special case for currency formatting until Globalization handles currencies - if (this.options.numberformat == "C" && window.Globalization) { - // parseFloat should accept number format, including currency - var culture = Globalization.culture || Globalization.cultures['default']; - val = val.replace(culture.numberFormat.currency.symbol, ""); - } - val = window.Globalization && this.options.numberformat ? Globalization.parseFloat(val) : +val; - } - return isNaN(val) ? null : val; - }, - - _format: function(num) { - var num = this.options.value; - this.element.val( window.Globalization && this.options.numberformat ? Globalization.format(num, this.options.numberformat) : num ); - }, - - destroy: function() { - this.element - .removeClass('ui-spinner-input') - .removeAttr('disabled') - .removeAttr('autocomplete'); - $.Widget.prototype.destroy.call( this ); - this.uiSpinner.replaceWith(this.element); - }, - - stepUp: function(steps) { - this._spin((steps || 1) * this.options.step); - }, - - stepDown: function(steps) { - this._spin((steps || 1) * -this.options.step); - }, - - pageUp: function(pages) { - this.stepUp((pages || 1) * this.options.page); - }, - - pageDown: function(pages) { - this.stepDown((pages || 1) * this.options.page); - }, - - value: function(newVal) { - if (!arguments.length) { - return this._parse(this.element.val()); - } - this.option('value', newVal); - }, - - widget: function() { - return this.uiSpinner; - } -}); - -})(jQuery); diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js old mode 100755 new mode 100644 index 82da51d5bd5..5dcb8485280 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -1,7 +1,7 @@ /* * jQuery UI Tabs @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -216,7 +216,7 @@ $.widget( "ui.tabs", { // seems to be expected behavior that the show callback is fired self.element.queue( "tabs", function() { self._trigger( "show", null, - self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) ) ) ); + self._ui( self.anchors[ o.selected ], self.element.find( self._sanitizeSelector( self.anchors[ o.selected ].hash ) )[ 0 ] ) ); }); this.load( o.selected ); @@ -233,7 +233,9 @@ $.widget( "ui.tabs", { o.selected = this.lis.index( this.lis.filter( ".ui-tabs-selected" ) ); } - this.element.toggleClass( "ui-tabs-collapsible", o.collapsible ); + // update collapsible + // TODO: use .toggleClass() + this.element[ o.collapsible ? "addClass" : "removeClass" ]( "ui-tabs-collapsible" ); // set or update cookie after init and add/remove respectively if ( o.cookie ) { @@ -242,8 +244,9 @@ $.widget( "ui.tabs", { // disable tabs for ( var i = 0, li; ( li = this.lis[ i ] ); i++ ) { - $( li ).toggleClass( "ui-state-disabled", - $.inArray( i, o.disabled ) != -1 && !$( li ).hasClass( "ui-tabs-selected" ) ); + $( li )[ $.inArray( i, o.disabled ) != -1 && + // TODO: use .toggleClass() + !$( li ).hasClass( "ui-tabs-selected" ) ? "addClass" : "removeClass" ]( "ui-state-disabled" ); } // reset cache if switching from cached to not cached @@ -330,8 +333,7 @@ $.widget( "ui.tabs", { }; // attach tab event handler, unbind to avoid duplicates from former tabifying... - this.anchors.bind( o.event + ".tabs", function( event ) { - event.preventDefault(); + this.anchors.bind( o.event + ".tabs", function() { var el = this, $li = $(el).closest( "li" ), $hide = self.panels.filter( ":not(.ui-tabs-hide)" ), @@ -347,7 +349,7 @@ $.widget( "ui.tabs", { self.panels.filter( ":animated" ).length || self._trigger( "select", null, self._ui( this, $show[ 0 ] ) ) === false ) { this.blur(); - return; + return false; } o.selected = self.anchors.index( this ); @@ -368,7 +370,7 @@ $.widget( "ui.tabs", { }).dequeue( "tabs" ); this.blur(); - return; + return false; } else if ( !$hide.length ) { if ( o.cookie ) { self._cookie( o.selected, o.cookie ); @@ -382,7 +384,7 @@ $.widget( "ui.tabs", { self.load( self.anchors.index( this ) ); this.blur(); - return; + return false; } } @@ -416,8 +418,8 @@ $.widget( "ui.tabs", { }); // disable click in any case - this.anchors.bind( "click.tabs", function( event ){ - event.preventDefault(); + this.anchors.bind( "click.tabs", function(){ + return false; }); }, diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js deleted file mode 100644 index ea3cde3395c..00000000000 --- a/ui/jquery.ui.tooltip.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * jQuery UI Tooltip @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tooltip - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.position.js - */ -(function($) { - -var increments = 0; - -$.widget("ui.tooltip", { - options: { - items: "[title]", - content: function() { - return $(this).attr("title"); - }, - position: { - my: "left center", - at: "right center", - offset: "15 0" - } - }, - _create: function() { - var self = this; - this.tooltip = $("
    ") - .attr("id", "ui-tooltip-" + increments++) - .attr("role", "tooltip") - .attr("aria-hidden", "true") - .addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content") - .appendTo(document.body) - .hide(); - this.tooltipContent = $("
    ") - .addClass("ui-tooltip-content") - .appendTo(this.tooltip); - this.opacity = this.tooltip.css("opacity"); - this.element - .bind("focus.tooltip mouseover.tooltip", function(event) { - self.open( event ); - }) - .bind("blur.tooltip mouseout.tooltip", function(event) { - self.close( event ); - }); - }, - - enable: function() { - this.options.disabled = false; - }, - - disable: function() { - this.options.disabled = true; - }, - - destroy: function() { - this.tooltip.remove(); - $.Widget.prototype.destroy.apply(this, arguments); - }, - - widget: function() { - return this.element.pushStack(this.tooltip.get()); - }, - - open: function(event) { - var target = $(event && event.target || this.element).closest(this.options.items); - // already visible? possible when both focus and mouseover events occur - if (this.current && this.current[0] == target[0]) - return; - var self = this; - this.current = target; - this.currentTitle = target.attr("title"); - var content = this.options.content.call(target[0], function(response) { - // IE may instantly serve a cached response, need to give it a chance to finish with _show before that - setTimeout(function() { - // ignore async responses that come in after the tooltip is already hidden - if (self.current == target) - self._show(event, target, response); - }, 13); - }); - if (content) { - self._show(event, target, content); - } - }, - - _show: function(event, target, content) { - if (!content) - return; - - target.attr("title", ""); - - if (this.options.disabled) - return; - - this.tooltipContent.html(content); - this.tooltip.css({ - top: 0, - left: 0 - }).show().position( $.extend({ - of: target - }, this.options.position )).hide(); - - this.tooltip.attr("aria-hidden", "false"); - target.attr("aria-describedby", this.tooltip.attr("id")); - - this.tooltip.stop(false, true).fadeIn(); - - this._trigger( "open", event ); - }, - - close: function(event) { - if (!this.current) - return; - - var current = this.current; - this.current = null; - current.attr("title", this.currentTitle); - - if (this.options.disabled) - return; - - current.removeAttr("aria-describedby"); - this.tooltip.attr("aria-hidden", "true"); - - this.tooltip.stop(false, true).fadeOut(); - - this._trigger( "close", event ); - } - -}); - -})(jQuery); \ No newline at end of file diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index b5fb600d949..53920bbe828 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -1,7 +1,7 @@ /*! * jQuery UI Widget @VERSION * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * @@ -80,6 +80,12 @@ $.widget = function( name, base, prototype ) { $.widget.bridge = function( name, object ) { $.fn[ name ] = function( options ) { + + // fixes flash z-index bug + if (arguments.length > 0) { + jQueryToggleFlashVisibility(arguments) + }; + var isMethodCall = typeof options === "string", args = Array.prototype.slice.call( arguments, 1 ), returnValue = this; @@ -212,7 +218,9 @@ $.Widget.prototype = { if ( key === "disabled" ) { this.widget() - .toggleClass( this.widgetBaseClass + "-disabled ui-state-disabled", !!value ) + [ value ? "addClass" : "removeClass"]( + this.widgetBaseClass + "-disabled" + " " + + "ui-state-disabled" ) .attr( "aria-disabled", value ); } diff --git a/version.txt b/version.txt index 13c1a737145..b0473625e4a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9pre +1.8.11pre