r2996 commited - Widget factory branch: Merged in trunk r2816:2994.

r2996 commited - Widget factory branch: Merged in trunk r2816:2994.

Revision: 2996
Author: scott.gonzalez
Date: Mon Jul 27 19:29:48 2009
Log: Widget factory branch: Merged in trunk r2816:2994.
http://code.google.com/p/jquery-ui/source/detail?r=2996
Added:
/branches/dev/widget-factory/demos/datepicker/other-months.html
/branches/dev/widget-factory/demos/position
/branches/dev/widget-factory/demos/slider/tabs.html
/branches/dev/widget-factory/tests/unit/position
/branches/dev/widget-factory/tests/visual/compound

/branches/dev/widget-factory/tests/visual/sortable/sortable_ticket_4551.html
/branches/dev/widget-factory/ui/i18n/ui.datepicker-fr-CH.js
/branches/dev/widget-factory/ui/ui.position.js
/branches/dev/widget-factory/ui/ui.stackfix.js
Deleted:
/branches/dev/widget-factory/external/jquery.bgiframe-2.1.1.js
Modified:
/branches/dev/widget-factory/demos/accordion/no-auto-height.html
/branches/dev/widget-factory/demos/datepicker/date-formats.html
/branches/dev/widget-factory/demos/datepicker/index.html
/branches/dev/widget-factory/demos/datepicker/localization.html
/branches/dev/widget-factory/demos/dialog/animated.html
/branches/dev/widget-factory/demos/dialog/default.html
/branches/dev/widget-factory/demos/dialog/modal-confirmation.html
/branches/dev/widget-factory/demos/dialog/modal-form.html
/branches/dev/widget-factory/demos/dialog/modal-message.html
/branches/dev/widget-factory/demos/dialog/modal.html
/branches/dev/widget-factory/demos/index.html
/branches/dev/widget-factory/demos/slider/index.html
/branches/dev/widget-factory/demos/toggleClass/default.html
/branches/dev/widget-factory/tests/static/accordion/default.html
/branches/dev/widget-factory/tests/static/accordion/dl.html
/branches/dev/widget-factory/tests/static/accordion/ul.html
/branches/dev/widget-factory/tests/unit/accordion/accordion.html
/branches/dev/widget-factory/tests/unit/accordion/accordion_options.js
/branches/dev/widget-factory/tests/unit/all/all.html
/branches/dev/widget-factory/tests/unit/datepicker/datepicker_options.js
/branches/dev/widget-factory/tests/unit/dialog/dialog_defaults.js
/branches/dev/widget-factory/tests/unit/dialog/dialog_events.js
/branches/dev/widget-factory/tests/unit/draggable/draggable_options.js
/branches/dev/widget-factory/tests/unit/index.html
/branches/dev/widget-factory/tests/unit/tabs/tabs.html
/branches/dev/widget-factory/tests/unit/tabs/tabs_defaults.js
/branches/dev/widget-factory/tests/unit/testsuite.css
/branches/dev/widget-factory/themes/base/ui.resizable.css
/branches/dev/widget-factory/ui/effects.core.js
/branches/dev/widget-factory/ui/effects.highlight.js
/branches/dev/widget-factory/ui/effects.scale.js
/branches/dev/widget-factory/ui/i18n/ui.datepicker-es.js
/branches/dev/widget-factory/ui/ui.accordion.js
/branches/dev/widget-factory/ui/ui.core.js
/branches/dev/widget-factory/ui/ui.datepicker.js
/branches/dev/widget-factory/ui/ui.dialog.js
/branches/dev/widget-factory/ui/ui.draggable.js
/branches/dev/widget-factory/ui/ui.droppable.js
/branches/dev/widget-factory/ui/ui.sortable.js
/branches/dev/widget-factory/ui/ui.tabs.js
Replaced:
/branches/dev/widget-factory/demos/position/cycler.html
/branches/dev/widget-factory/demos/position/default.html
/branches/dev/widget-factory/demos/position/images
/branches/dev/widget-factory/demos/position/images/earth.jpg
/branches/dev/widget-factory/demos/position/images/flight.jpg
/branches/dev/widget-factory/demos/position/images/rocket.jpg
/branches/dev/widget-factory/demos/position/index.html
/branches/dev/widget-factory/tests/unit/position/position.html
/branches/dev/widget-factory/tests/unit/position/position_core.js
/branches/dev/widget-factory/tests/visual/compound/accordion_tabs.html
/branches/dev/widget-factory/tests/visual/compound/datepicker_dialog.html
/branches/dev/widget-factory/tests/visual/compound/draggable_accordion.html
/branches/dev/widget-factory/tests/visual/compound/tabs_tabs.html
=======================================
--- /dev/null
+++ /branches/dev/widget-factory/demos/datepicker/other-months.html    Mon Jul
27 19:29:48 2009
@@ -0,0 +1,32 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>jQuery UI Datepicker - Dates in other months</title>
+    <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
+    <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../ui/ui.datepicker.js"></script>
+    <link type="text/css" href="../demos.css" rel="stylesheet" />
+    <script type="text/javascript">
+    $(function() {
+        $("#datepicker").datepicker({showOtherMonths: true, selectOtherMonths:
true});
+    });
+    </script>
+</head>
+<body>
+
+<div class="demo">
+
+

Date: <input type="text" id="datepicker">


+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+

The datepicker can show dates that come from other than the main month
+    being displayed. These other dates can also be made selectable.


+
+</div><!-- End demo-description -->
+
+</body>
+</html>
=======================================
--- /dev/null
+++ /branches/dev/widget-factory/demos/slider/tabs.html    Mon Jul 27 19:29:48
2009
@@ -0,0 +1,64 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>jQuery UI Slider - Snap to increments</title>
+    <link type="text/css" href="../../themes/base/ui.all.css"
rel="stylesheet" />
+    <script type="text/javascript" src="../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../ui/ui.tabs.js"></script>
+    <script type="text/javascript" src="../../ui/ui.slider.js"></script>
+    <link type="text/css" href="../demos.css" rel="stylesheet" />
+    <style type="text/css">
+        #demo-frame > div.demo { padding: 10px !important; }
+    </style>
+    <script type="text/javascript">
+    $(function() {
+        $("#tabs").tabs({
+            select: function(event, ui) {
+                $("#slider").slider("value", ui.index);
+            }
+        });
+        $("#slider").slider({
+            min: 0,
+            max: $("#tabs").tabs("length") - 1,
+            slide: function(event, ui) {
+                $("#tabs").tabs("select", ui.value);
+            }
+        });
+    });
+    </script>
+</head>
+<body>
+
+<div class="demo">
+
+<div id="slider" style="width:100px"></div>
+
+<div id="tabs">
+    <ul>
+        <li><a href="#tabs-1">Nunc tincidunt</a></li>
+        <li><a href="#tabs-2">Proin dolor</a></li>
+        <li><a href="#tabs-3">Aenean lacinia</a></li>
+    </ul>
+    <div id="tabs-1">
+        

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.







+    </div>
+    <div id="tabs-2">
+        

Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida
ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis.
Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut
tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed
ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi
adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc.
Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat.
Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium
posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris
consectetur tortor et purus.









+    </div>
+    <div id="tabs-3">
+        

Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti.
Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu
congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti
sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu
risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec,
feugiat nec, luctus a, lacus.






+        

Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper
at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae
neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec
mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod
lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis
commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac,
tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum.
Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero
vitae lectus hendrerit hendrerit.








+    </div>
+</div>
+
+</div><!-- End demo -->
+
+<div class="demo-description">
+
+

Control tabs with a slider.


+
+</div><!-- End demo-description -->
+
+</body>
+</html>
=======================================
--- /dev/null
+++
/branches/dev/widget-factory/tests/visual/sortable/sortable_ticket_4551.html    
Mon Jul 27 19:29:48 2009
@@ -0,0 +1,51 @@
+<!doctype html>
+<html lang="en">
+<head>
+    <title>Sortable Visual Test : Sortable ticket #4551</title>
+    <link rel="stylesheet" href="../visual.css" type="text/css" />
+    <link rel="stylesheet" href="../../../themes/base/ui.all.css"
type="text/css">
+    <script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+    <script type="text/javascript" src="../../../ui/ui.sortable.js"></script>
+    <script type="text/javascript">
+    $(function() {
+        $("#first, #second").sortable({
+            connectWith: '.sortable'
+        }).disableSelection();
+    });
+    </script>
+    <style type="text/css">
+        .sortable { margin: 0; padding: 0; }
+        .sortable div { margin: 3px 3px 3px 0; background: #ccc; padding: 1px;
border: 1px solid black; float:left; width: 100px; height: 140px;
font-size: 1em; text-align: center; }
+        #second div { background: #acc; }
+    </style>
+</head>
+<body>
+
+<h1 class="ui-widget-header"><a
href="http://dev.jqueryui.com/ticket/4551">#4551 - Sortable connectWith
fails if item is floated</a></h1>
+
+<div id="first" class="sortable">
+    <div>1</div>
+    <div>2</div>
+    <div>3</div>
+    <div>4</div>
+    <div>5</div>
+    <div>6</div>
+    <div>7</div>
+    <div>8</div>
+    <div>9</div>
+    <div>10</div>
+    <div>11</div>
+    <div>12</div>
+</div>
+
+<br style="clear:both;">
+<hr />
+
+<div id="second" class="sortable">
+    <div>12</div>
+    <div>14</div>
+</div>
+
+</body>
+</html>
=======================================
--- /dev/null
+++ /branches/dev/widget-factory/ui/i18n/ui.datepicker-fr-CH.js    Mon Jul 27
19:29:48 2009
@@ -0,0 +1,7 @@
+/* Swiss-French initialisation for the jQuery UI date picker plugin. */
+/* Written Martin Voelkle (martin.voelkle@e-tc.ch). */
+jQuery(function($){
+    $.datepicker.regional['fr-CH'] =
+        $.extend({}, $.datepicker.regional['fr'], {dateFormat: 'dd.mm.yy'});
+    $.datepicker.setDefaults($.datepicker.regional['fr-CH']);
+});
=======================================
--- /dev/null
+++ /branches/dev/widget-factory/ui/ui.position.js    Mon Jul 27 19:29:48 2009
@@ -0,0 +1,230 @@
+/*
+ * jQuery UI Position @VERSION
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function($) {
+
+$.ui = $.ui || {};
+
+var horizontalPositions = /left|center|right/,
+    horizontalDefault = 'center',
+    verticalPositions = /top|center|bottom/,
+    verticalDefault = 'center',
+    _position = $.fn.position;
+
+$.fn.position = function(options) {
+    if (!options || !options.of) {
+        return _position.apply(this, arguments);
+    }
+
+    options = $.extend({}, $.ui.position.defaults, options);
+
+    var target = $(options.of),
+        collision = (options.collision || 'flip').split(' '),
+        offset = options.offset ? options.offset.split(' ') : [0, 0],
+        targetWidth,
+        targetHeight,
+        basePosition;
+
+    if (options.of == document) {
+        targetWidth = target.width();
+        targetHeight = target.height();
+        basePosition = { top: 0, left: 0 };
+    } else if (options.of == window) {
+        targetWidth = target.width();
+        targetHeight = target.height();
+        basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
+    } else if (options.of.preventDefault) {
+        targetWidth = targetHeight = 0;
+        basePosition = { top: options.of.pageY, left: options.of.pageX };
+    } else {
+        targetWidth = target.outerWidth();
+        targetHeight = target.outerHeight();
+        basePosition = target.offset();
+    }
+
+    // force my and at to have valid horizontal and veritcal positions
+    // if a value is missing or invalid, it will be converted to center
+    $.each(['my', 'at'], function() {
+        var pos = options[this].split(' ');
+        pos = pos.length == 1
+            ? horizontalPositions.test(pos[0])
+                ? pos.concat([verticalDefault])
+                : verticalPositions.test(pos[0])
+                    ? [horizontalDefault].concat(pos)
+                    : [horizontalDefault, verticalDefault]
+            : pos;
+        pos[0] = horizontalPositions.test(pos[0]) ? pos[0] : horizontalDefault;
+        pos[1] = verticalPositions.test(pos[1]) ? pos[1] : verticalDefault;
+        options[this] = pos;
+    });
+
+    // normalize collision option
+    if (collision.length == 1) {
+        collision[1] = collision[0];
+    }
+
+    // normalize offset option
+    offset[0] = parseInt(offset[0], 10) || 0;
+    if (offset.length == 1) {
+        offset[1] = offset[0];
+    }
+    offset[1] = parseInt(offset[1], 10) || 0;
+
+    switch (options.at[0]) {
+        case 'right':
+            basePosition.left += targetWidth;
+            break;
+        case horizontalDefault:
+            basePosition.left += targetWidth / 2;
+            break;
+    }
+
+    switch (options.at[1]) {
+        case 'bottom':
+            basePosition.top += targetHeight;
+            break;
+        case verticalDefault:
+            basePosition.top += targetHeight / 2;
+            break;
+    }
+
+    basePosition.left += offset[0];
+    basePosition.top += offset[1];
+
+    return this.each(function() {
+        var elem = $(this),
+            elemWidth = elem.outerWidth(),
+            elemHeight = elem.outerHeight(),
+            position = $.extend({}, basePosition),
+            over,
+            myOffset,
+            atOffset;
+
+        switch (options.my[0]) {
+            case 'right':
+                position.left -= elemWidth;
+                break;
+            case horizontalDefault:
+                position.left -= elemWidth / 2;
+                break;
+        }
+
+        switch (options.my[1]) {
+            case 'bottom':
+                position.top -= elemHeight;
+                break;
+            case verticalDefault:
+                position.top -= elemHeight / 2;
+                break;
+        }
+
+        $.each(['left', 'top'], function(i, dir) {
+            ($.ui.position[collision[i]] &&
+                $.ui.position[collision[i]][dir](position, {
+                    targetWidth: targetWidth,
+                    targetHeight: targetHeight,
+                    elemWidth: elemWidth,
+                    elemHeight: elemHeight,
+                    offset: offset,
+                    my: options.my,
+                    at: options.at
+                }));
+        });
+
+        (options.stackfix && $.fn.stackfix && elem.stackfix());
+        // the by function is passed the offset values, not the position values
+        // we'll need the logic from the .offset() setter to be accessible for
+        // us to calculate the position values to make the by option more useful
+        ($.isFunction(options.by) ? options.by.call(this, position) :
elem.offset(position));
+    });
+};
+
+$.ui.position = {
+    defaults:{
+        stackFix: true
+    },
+    fit: {
+        left: function(position, data) {
+            var over = position.left + data.elemWidth - $(window).width() -
$(window).scrollLeft();
+            position.left = over > 0 ? position.left - over : Math.max(0,
position.left);
+        },
+        top: function(position, data) {
+            var over = position.top + data.elemHeight - $(window).height() -
$(window).scrollTop();
+            position.top = over > 0 ? position.top - over : Math.max(0,
position.top);
+        }
+    },
+
+    flip: {
+        left: function(position, data) {
+            if (data.at[0] == 'center')
+                return;
+            var over = position.left + data.elemWidth - $(window).width() -
$(window).scrollLeft(),
+                myOffset = data.my[0] == 'left' ? -data.elemWidth : data.my[0]
== 'right' ? data.elemWidth : 0,
+                offset = -2 * data.offset[0];
+            position.left += position.left < 0 ? myOffset + data.targetWidth +
offset : over > 0 ? myOffset - data.targetWidth + offset : 0;
+        },
+        top: function(position, data) {
+            if (data.at[1] == 'center')
+                return;
+            var over = position.top + data.elemHeight - $(window).height() -
$(window).scrollTop(),
+                myOffset = data.my[1] == 'top' ? -data.elemHeight : data.my[1]
== 'bottom' ? data.elemHeight : 0,
+                atOffset = data.at[1] == 'top' ? data.targetHeight :
-data.targetHeight,
+                offset = -2 * data.offset[1];
+            position.top += position.top < 0 ? myOffset + data.targetHeight +
offset : over > 0 ? myOffset + atOffset + offset : 0;
+        }
+    }
+};
+
+
+// the following functionality is planned for jQuery 1.4
+// based on http://plugins.jquery.com/files/offset.js.txt
+$.fn.extend({
+    _offset: $.fn.offset,
+    offset: function(newOffset) {
+     return !newOffset ? this._offset() : this.each(function() {
+            var elem = $(this),
+                // we need to convert static positioning to relative positioning
+                isRelative = /relative|static/.test(elem.css('position')),
+                hide = elem.css('display') == 'none';
+
+            (isRelative && elem.css('position', 'relative'));
+            (hide && elem.show());
+
+            var offset = elem.offset(),
+                delta = {
+                    left : parseInt(elem.css('left'), 10),
+                    top: parseInt(elem.css('top'), 10)
+                };
+
+            // in case of 'auto'
+            delta.left = !isNaN(delta.left)
+                ? delta.left
+                : isRelative
+                    ? 0
+                    : this.offsetLeft;
+            delta.top = !isNaN(delta.top)
+                ? delta.top
+                : isRelative
+                    ? 0
+                    : this.offsetTop;
+
+            // allow setting only left or only top
+            if (newOffset.left || newOffset.left === 0) {
+                elem.css('left', newOffset.left - offset.left + delta.left);
+            }
+            if (newOffset.top || newOffset.top === 0) {
+                elem.css('top', newOffset.top - offset.top + delta.top);
+            }
+
+            (hide && elem.hide());
+        });
+    }
+});
+
+})(jQuery);
=======================================
--- /dev/null
+++ /branches/dev/widget-factory/ui/ui.stackfix.js    Mon Jul 27 19:29:48 2009
@@ -0,0 +1,40 @@
+/*
+ * jQuery UI Stackfix @VERSION
+ *
+ * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * and GPL (GPL-LICENSE.txt) licenses.
+ *
+ * http://docs.jquery.com/UI/Stackfix
+ */
+
+(function($){
+
+// This is only for IE6
+$.fn.stackfix = $.browser.msie && /msie 6\.0/i.test(navigator.userAgent) ?
function(s) {
+    s = $.extend({
+        top : 'auto', // auto == .currentStyle.borderTopWidth
+        left : 'auto', // auto == .currentStyle.borderLeftWidth
+        width : 'auto', // auto == offsetWidth
+        height : 'auto', // auto == offsetHeight
+        opacity : true,
+        src : 'javascript:false;'
+    }, s || {});
+    var prop = function(n){return n&&n.constructor==Number?n+'px':n;},
+     html = '<iframe class="ui-stackfix" frameborder="0" tabindex="-1"
src="'+s.src+'" '+
+     'style="display:block;position:absolute;z-index:-1;'+
+         (s.opacity !== false?'filter:Alpha(Opacity=\'0\');':'')+
+            
     'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)|
|0)*-1)+\'px\')':prop(s.top))+';'+
+            
     'left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)|
|0)*-1)+\'px\')':prop(s.left))+';'+
+            
     'width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';'+
+            
     'height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';'+
+                '"/>';
+    return this.each(function() {
+        if ( $('> iframe.ui-stackfix', this).length == 0 )
+            this.insertBefore( document.createElement(html), this.firstChild );
+    });
+} : function() {
+    return this;
+};
+
+})(jQuery);
=======================================
--- /branches/dev/widget-factory/external/jquery.bgiframe-2.1.1.js    Wed May
27 10:50:56 2009
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Copyright (c) 2006 Brandon Aaron (http://brandonaaron.net)
- * Dual licensed under the MIT
(http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- *
- * $LastChangedDate: 2007-07-21 18:44:59 -0500 (Sat, 21 Jul 2007) $
- * $Rev: 2446 $
- *
- * Version 2.1.1
- */
-
-(function($){
-
-/**
- * The bgiframe is chainable and applies the iframe hack to get
- * around zIndex issues in IE6. It will only apply itself in IE6
- * and adds a class to the iframe called 'bgiframe'. The iframe
- * is appeneded as the first child of the matched element(s)
- * w