|
Modified: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js?rev=1398771&r1=1398770&r2=1398771&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js (original) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.datepicker.js Tue Oct 16 12:57:46 2012 @@ -1,18 +1,19 @@ /*! - * jQuery UI Datepicker 1.8.22 + * jQuery UI Datepicker 1.9.0 + * http://jqueryui.com * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Datepicker + * http://api.jqueryui.com/datepicker/ * * Depends: * jquery.ui.core.js */ (function( $, undefined ) { -$.extend($.ui, { datepicker: { version: "1.8.22" } }); +$.extend($.ui, { datepicker: { version: "1.9.0" } }); var PROP_NAME = 'datepicker'; var dpuuid = new Date().getTime(); @@ -382,7 +383,7 @@ $.extend(Datepicker.prototype, { var inline = $target.children('.' + this._inlineClass); inline.children().removeClass('ui-state-disabled'); inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). - removeAttr("disabled"); + prop("disabled", false); } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value == target ? null : value); }); // delete entry @@ -407,7 +408,7 @@ $.extend(Datepicker.prototype, { var inline = $target.children('.' + this._inlineClass); inline.children().addClass('ui-state-disabled'); inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). - attr("disabled", "disabled"); + prop("disabled", true); } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value == target ? null : value); }); // delete entry @@ -628,7 +629,7 @@ $.extend(Datepicker.prototype, { }, /* Pop-up the date picker for a given input field. - If false returned from beforeShow event handler do not show. + If false returned from beforeShow event handler do not show. @param input element - the input field attached to the date picker or event - if triggered by focus */ _showDatepicker: function(input) { @@ -647,7 +648,7 @@ $.extend(Datepicker.prototype, { var beforeShow = $.datepicker._get(inst, 'beforeShow'); var beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; if(beforeShowSettings === false){ - //false + //false return; } extendRemove(inst.settings, beforeShowSettings); @@ -665,10 +666,6 @@ $.extend(Datepicker.prototype, { isFixed |= $(this).css('position') == 'fixed'; return !isFixed; }); - if (isFixed && $.browser.opera) { // correction for Opera when fixed and scrolled - $.datepicker._pos[0] -= document.documentElement.scrollLeft; - $.datepicker._pos[1] -= document.documentElement.scrollTop; - } var offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; $.datepicker._pos = null; //to avoid flashes on Firefox @@ -695,7 +692,9 @@ $.extend(Datepicker.prototype, { }; inst.dpDiv.zIndex($(input).zIndex()+1); $.datepicker._datepickerShowing = true; - if ($.effects && $.effects[showAnim]) + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) inst.dpDiv.show(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); else inst.dpDiv[showAnim || 'show']((showAnim ? duration : null), postProcess); @@ -709,8 +708,7 @@ $.extend(Datepicker.prototype, { /* Generate the date picker content. */ _updateDatepicker: function(inst) { - var self = this; - self.maxRows = 4; //Reset the max number of rows being displayed (see #7043) + this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) var borders = $.datepicker._getBorders(inst.dpDiv); instActive = inst; // for delegate hover events inst.dpDiv.empty().append(this._generateHTML(inst)); @@ -785,11 +783,11 @@ $.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 || $.expr.filters.hidden(obj))) { - obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; - } - var position = $(obj).offset(); - return [position.left, position.top]; + while (obj && (obj.type == 'hidden' || obj.nodeType != 1 || $.expr.filters.hidden(obj))) { + obj = obj[isRTL ? 'previousSibling' : 'nextSibling']; + } + var position = $(obj).offset(); + return [position.left, position.top]; }, /* Hide the date picker from view. @@ -804,7 +802,9 @@ $.extend(Datepicker.prototype, { var postProcess = function() { $.datepicker._tidyDialog(inst); }; - if ($.effects && $.effects[showAnim]) + + // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed + if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) inst.dpDiv.hide(showAnim, $.datepicker._get(inst, 'showOptions'), duration, postProcess); else inst.dpDiv[(showAnim == 'slideDown' ? 'slideUp' : @@ -1096,7 +1096,10 @@ $.extend(Datepicker.prototype, { } } if (iValue < value.length){ - throw "Extra/unparsed characters found in date: " + value.substring(iValue); + var extra = value.substr(iValue); + if (!/^\s+/.test(extra)) { + throw "Extra/unparsed characters found in date: " + extra; + } } if (year == -1) year = new Date().getFullYear(); @@ -1408,7 +1411,7 @@ $.extend(Datepicker.prototype, { */ _attachHandlers: function(inst) { var stepMonths = this._get(inst, 'stepMonths'); - var id = '#' + inst.id; + var id = '#' + inst.id.replace( /\\\\/g, "\\" ); inst.dpDiv.find('[data-handler]').map(function () { var handler = { prev: function () { @@ -1774,23 +1777,18 @@ $.extend(Datepicker.prototype, { */ function bindHover(dpDiv) { var selector = 'button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a'; - return dpDiv.bind('mouseout', function(event) { - var elem = $( event.target ).closest( selector ); - if ( !elem.length ) { - return; - } - elem.removeClass( "ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover" ); + return dpDiv.delegate(selector, 'mouseout', function() { + $(this).removeClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).removeClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).removeClass('ui-datepicker-next-hover'); }) - .bind('mouseover', function(event) { - var elem = $( event.target ).closest( selector ); - if ($.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0]) || - !elem.length ) { - return; + .delegate(selector, 'mouseover', function(){ + if (!$.datepicker._isDisabledDatepicker( instActive.inline ? dpDiv.parent()[0] : instActive.input[0])) { + $(this).parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); + $(this).addClass('ui-state-hover'); + if (this.className.indexOf('ui-datepicker-prev') != -1) $(this).addClass('ui-datepicker-prev-hover'); + if (this.className.indexOf('ui-datepicker-next') != -1) $(this).addClass('ui-datepicker-next-hover'); } - elem.parents('.ui-datepicker-calendar').find('a').removeClass('ui-state-hover'); - elem.addClass('ui-state-hover'); - if (elem.hasClass('ui-datepicker-prev')) elem.addClass('ui-datepicker-prev-hover'); - if (elem.hasClass('ui-datepicker-next')) elem.addClass('ui-datepicker-next-hover'); }); } @@ -1803,15 +1801,9 @@ function extendRemove(target, props) { return target; }; -/* Determine whether an object is an array. */ -function isArray(a) { - return (a && (($.browser.safari && typeof a == 'object' && a.length) || - (a.constructor && a.constructor.toString().match(/\Array\(\)/)))); -}; - /* Invoke the datepicker functionality. @param options string - a command, optionally followed by additional parameters or - Object - settings for attaching new datepicker functionality + Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function(options){ @@ -1823,7 +1815,7 @@ $.fn.datepicker = function(options){ /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick). - find('body').append($.datepicker.dpDiv); + find(document.body).append($.datepicker.dpDiv); $.datepicker.initialized = true; } @@ -1845,7 +1837,7 @@ $.fn.datepicker = function(options){ $.datepicker = new Datepicker(); // singleton instance $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); -$.datepicker.version = "1.8.22"; +$.datepicker.version = "1.9.0"; // Workaround for #4055 // Add another global to avoid noConflict issues with inline event handlers Modified: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.dialog.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.dialog.js?rev=1398771&r1=1398770&r2=1398771&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.dialog.js (original) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.dialog.js Tue Oct 16 12:57:46 2012 @@ -1,11 +1,12 @@ /*! - * jQuery UI Dialog 1.8.22 + * jQuery UI Dialog 1.9.0 + * http://jqueryui.com * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Dialog + * http://api.jqueryui.com/dialog/ * * Depends: * jquery.ui.core.js @@ -18,11 +19,7 @@ */ (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, @@ -37,173 +34,161 @@ var uiDialogClasses = maxWidth: true, minHeight: true, minWidth: true - }, - // support for jQuery 1.3.2 - handle common attrFn methods for dialog - attrFn = $.attrFn || { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true, - click: true }; $.widget("ui.dialog", { + version: "1.9.0", options: { 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', - collision: 'fit', + my: "center", + at: "center", + of: window, + 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 = ""; } - + this.oldPosition = { + parent: this.element.parent(), + index: this.element.parent().children().index( this.element ) + }; this.options.title = this.options.title || this.originalTitle; - var self = this, - options = self.options, + var that = this, + options = this.options, - title = options.title || ' ', - titleId = $.ui.dialog.getTitleId(self.element), + title = options.title || " ", - uiDialog = (self.uiDialog = $('<div></div>')) - .appendTo(document.body) - .hide() - .addClass(uiDialogClasses + options.dialogClass) + uiDialog = ( this.uiDialog = $( "<div>" ) ) + .addClass( uiDialogClasses + options.dialogClass ) .css({ + display: "none", + outline: 0, // TODO: move to stylesheet zIndex: options.zIndex }) // setting tabIndex makes the div focusable - // setting outline to 0 prevents a border on focus in Mozilla - .attr('tabIndex', -1).css('outline', 0).keydown(function(event) { - if (options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE) { - - self.close(event); + .attr( "tabIndex", -1) + .keydown(function( event ) { + if ( options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + that.close( event ); event.preventDefault(); } }) - .attr({ - role: 'dialog', - 'aria-labelledby': titleId + .mousedown(function( event ) { + that.moveToTop( false, event ); }) - .mousedown(function(event) { - self.moveToTop(false, event); - }), + .appendTo( "body" ), - uiDialogContent = self.element + uiDialogContent = this.element .show() - .removeAttr('title') - .addClass( - 'ui-dialog-content ' + - 'ui-widget-content') - .appendTo(uiDialog), - - uiDialogTitlebar = (self.uiDialogTitlebar = $('<div></div>')) - .addClass( - 'ui-dialog-titlebar ' + - 'ui-widget-header ' + - 'ui-corner-all ' + - 'ui-helper-clearfix' - ) - .prependTo(uiDialog), - - uiDialogTitlebarClose = $('<a href="#"></a>') - .addClass( - 'ui-dialog-titlebar-close ' + - 'ui-corner-all' - ) - .attr('role', 'button') - .hover( - function() { - uiDialogTitlebarClose.addClass('ui-state-hover'); - }, - function() { - uiDialogTitlebarClose.removeClass('ui-state-hover'); - } - ) - .focus(function() { - uiDialogTitlebarClose.addClass('ui-state-focus'); - }) - .blur(function() { - uiDialogTitlebarClose.removeClass('ui-state-focus'); - }) - .click(function(event) { - self.close(event); - return false; + .removeAttr( "title" ) + .addClass( "ui-dialog-content ui-widget-content" ) + .appendTo( uiDialog ), + + uiDialogTitlebar = ( this.uiDialogTitlebar = $( "<div>" ) ) + .addClass( "ui-dialog-titlebar ui-widget-header " + + "ui-corner-all ui-helper-clearfix" ) + .prependTo( uiDialog ), + + uiDialogTitlebarClose = $( "<a href='#'></a>" ) + .addClass( "ui-dialog-titlebar-close ui-corner-all" ) + .attr( "role", "button" ) + .click(function( event ) { + event.preventDefault(); + that.close( event ); }) - .appendTo(uiDialogTitlebar), + .appendTo( uiDialogTitlebar ), - uiDialogTitlebarCloseText = (self.uiDialogTitlebarCloseText = $('<span></span>')) - .addClass( - 'ui-icon ' + - 'ui-icon-closethick' - ) - .text(options.closeText) - .appendTo(uiDialogTitlebarClose), + uiDialogTitlebarCloseText = ( this.uiDialogTitlebarCloseText = $( "<span>" ) ) + .addClass( "ui-icon ui-icon-closethick" ) + .text( options.closeText ) + .appendTo( uiDialogTitlebarClose ), + + uiDialogTitle = $( "<span>" ) + .uniqueId() + .addClass( "ui-dialog-title" ) + .html( title ) + .prependTo( uiDialogTitlebar ), - uiDialogTitle = $('<span></span>') - .addClass('ui-dialog-title') - .attr('id', titleId) - .html(title) - .prependTo(uiDialogTitlebar); + uiDialogButtonPane = ( this.uiDialogButtonPane = $( "<div>" ) ) + .addClass( "ui-dialog-buttonpane ui-widget-content ui-helper-clearfix" ), - //handling of deprecated beforeclose (vs beforeClose) option - //Ticket #4669 http://dev.jqueryui.com/ticket/4669 - //TODO: remove in 1.9pre - if ($.isFunction(options.beforeclose) && !$.isFunction(options.beforeClose)) { - options.beforeClose = options.beforeclose; - } + uiButtonSet = ( this.uiButtonSet = $( "<div>" ) ) + .addClass( "ui-dialog-buttonset" ) + .appendTo( uiDialogButtonPane ); + + uiDialog.attr({ + role: "dialog", + "aria-labelledby": uiDialogTitle.attr( "id" ) + }); - uiDialogTitlebar.find("*").add(uiDialogTitlebar).disableSelection(); + uiDialogTitlebar.find( "*" ).add( uiDialogTitlebar ).disableSelection(); + this._hoverable( uiDialogTitlebarClose ); + this._focusable( uiDialogTitlebarClose ); - if (options.draggable && $.fn.draggable) { - self._makeDraggable(); + if ( options.draggable && $.fn.draggable ) { + this._makeDraggable(); } - if (options.resizable && $.fn.resizable) { - self._makeResizable(); + if ( options.resizable && $.fn.resizable ) { + this._makeResizable(); } - self._createButtons(options.buttons); - self._isOpen = false; + this._createButtons( options.buttons ); + this._isOpen = false; - if ($.fn.bgiframe) { + if ( $.fn.bgiframe ) { uiDialog.bgiframe(); } + + // prevent tabbing out of modal dialogs + this._on( uiDialog, { keydown: function( event ) { + if ( !options.modal || event.keyCode !== $.ui.keyCode.TAB ) { + return; + } + + var tabbables = $( ":tabbable", uiDialog ), + first = tabbables.filter( ":first" ), + last = tabbables.filter( ":last" ); + + if ( event.target === last[0] && !event.shiftKey ) { + first.focus( 1 ); + return false; + } else if ( event.target === first[0] && event.shiftKey ) { + last.focus( 1 ); + return false; + } + }}); }, _init: function() { @@ -212,72 +197,81 @@ $.widget("ui.dialog", { } }, - destroy: function() { - var self = this; - - if (self.overlay) { - self.overlay.destroy(); - } - self.uiDialog.hide(); - self.element - .unbind('.dialog') - .removeData('dialog') - .removeClass('ui-dialog-content ui-widget-content') - .hide().appendTo('body'); - self.uiDialog.remove(); - - if (self.originalTitle) { - self.element.attr('title', self.originalTitle); + _destroy: function() { + var next, + oldPosition = this.oldPosition; + + if ( this.overlay ) { + this.overlay.destroy(); + } + this.uiDialog.hide(); + this.element + .removeClass( "ui-dialog-content ui-widget-content" ) + .hide() + .appendTo( "body" ); + this.uiDialog.remove(); + + if ( this.originalTitle ) { + this.element.attr( "title", this.originalTitle ); + } + + next = oldPosition.parent.children().eq( oldPosition.index ); + // Don't try to place the dialog next to itself (#8613) + if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { + next.before( this.element ); + } else { + oldPosition.parent.append( this.element ); } - - return self; }, widget: function() { return this.uiDialog; }, - close: function(event) { - var self = this, + close: function( event ) { + var that = this, maxZ, thisZ; - - if (false === self._trigger('beforeClose', event)) { + + if ( !this._isOpen ) { return; } - if (self.overlay) { - self.overlay.destroy(); + if ( false === this._trigger( "beforeClose", event ) ) { + return; } - self.uiDialog.unbind('keypress.ui-dialog'); - self._isOpen = false; + this._isOpen = false; - if (self.options.hide) { - self.uiDialog.hide(self.options.hide, function() { - self._trigger('close', event); + if ( this.overlay ) { + this.overlay.destroy(); + } + + if ( this.options.hide ) { + this.uiDialog.hide( this.options.hide, function() { + that._trigger( "close", event ); }); } else { - self.uiDialog.hide(); - self._trigger('close', event); + this.uiDialog.hide(); + this._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 ( this.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 !== that.uiDialog[0] ) { + thisZ = $( this ).css( "z-index" ); + if ( !isNaN( thisZ ) ) { + maxZ = Math.max( maxZ, thisZ ); } } }); $.ui.dialog.maxZ = maxZ; } - return self; + return this; }, isOpen: function() { @@ -286,179 +280,156 @@ $.widget("ui.dialog", { // the force parameter allows us to move modal dialogs to their correct // position on open - moveToTop: function(force, event) { - var self = this, - options = self.options, + moveToTop: function( force, event ) { + var options = this.options, saveScroll; - if ((options.modal && !force) || - (!options.stack && !options.modal)) { - return self._trigger('focus', event); + if ( ( options.modal && !force ) || + ( !options.stack && !options.modal ) ) { + return this._trigger( "focus", event ); } - if (options.zIndex > $.ui.dialog.maxZ) { + if ( options.zIndex > $.ui.dialog.maxZ ) { $.ui.dialog.maxZ = options.zIndex; } - if (self.overlay) { + if ( this.overlay ) { $.ui.dialog.maxZ += 1; - self.overlay.$el.css('z-index', $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ); + $.ui.dialog.overlay.maxZ = $.ui.dialog.maxZ; + this.overlay.$el.css( "z-index", $.ui.dialog.overlay.maxZ ); } - //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.scrollTop(), scrollLeft: self.element.scrollLeft() }; + // Save and then restore scroll + // Opera 9.5+ resets when parent z-index is changed. + // http://bugs.jqueryui.com/ticket/3193 + saveScroll = { + scrollTop: this.element.scrollTop(), + scrollLeft: this.element.scrollLeft() + }; $.ui.dialog.maxZ += 1; - self.uiDialog.css('z-index', $.ui.dialog.maxZ); - self.element.attr(saveScroll); - self._trigger('focus', event); + this.uiDialog.css( "z-index", $.ui.dialog.maxZ ); + this.element.attr( saveScroll ); + this._trigger( "focus", event ); - return self; + return this; }, open: function() { - if (this._isOpen) { return; } - - var self = this, - options = self.options, - uiDialog = self.uiDialog; - - self.overlay = options.modal ? new $.ui.dialog.overlay(self) : null; - self._size(); - self._position(options.position); - uiDialog.show(options.show); - self.moveToTop(true); - - // prevent tabbing out of modal dialogs - if ( options.modal ) { - uiDialog.bind( "keydown.ui-dialog", function( event ) { - if ( event.keyCode !== $.ui.keyCode.TAB ) { - return; - } - - var tabbables = $(':tabbable', this), - first = tabbables.filter(':first'), - last = tabbables.filter(':last'); - - if (event.target === last[0] && !event.shiftKey) { - first.focus(1); - return false; - } else if (event.target === first[0] && event.shiftKey) { - last.focus(1); - return false; - } - }); + if ( this._isOpen ) { + return; } + var hasFocus, + options = this.options, + uiDialog = this.uiDialog; + + this._size(); + this._position( options.position ); + uiDialog.show( options.show ); + this.overlay = options.modal ? new $.ui.dialog.overlay( this ) : null; + this.moveToTop( true ); + // 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._isOpen = true; - self._trigger('open'); - - return self; - }, - - _createButtons: function(buttons) { - var self = this, - hasButtons = false, - uiDialogButtonPane = $('<div></div>') - .addClass( - 'ui-dialog-buttonpane ' + - 'ui-widget-content ' + - 'ui-helper-clearfix' - ), - uiButtonSet = $( "<div></div>" ) - .addClass( "ui-dialog-buttonset" ) - .appendTo( uiDialogButtonPane ); + hasFocus = this.element.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); + if ( !hasFocus.length ) { + hasFocus = uiDialog; + } + } + hasFocus.eq( 0 ).focus(); + + this._isOpen = true; + this._trigger( "open" ); + + return this; + }, + + _createButtons: function( buttons ) { + var uiDialogButtonPane, uiButtonSet, + that = this, + hasButtons = false; // if we already have a button pane, remove it - self.uiDialog.find('.ui-dialog-buttonpane').remove(); + this.uiDialogButtonPane.remove(); + this.uiButtonSet.empty(); - 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 = $('<button type="button"></button>') + var button = $( "<button type='button'>" ) + .attr( props, true ) + .unbind( "click" ) .click(function() { - props.click.apply(self.element[0], arguments); + props.click.apply( that.element[0], arguments ); }) - .appendTo(uiButtonSet); - // can't use .attr( props, true ) with jQuery 1.3.2. - $.each( props, function( key, value ) { - if ( key === "click" ) { - return; - } - if ( key in attrFn ) { - button[ key ]( value ); - } else { - button.attr( key, value ); - } - }); - if ($.fn.button) { + .appendTo( that.uiButtonSet ); + if ( $.fn.button ) { button.button(); } }); - uiDialogButtonPane.appendTo(self.uiDialog); + this.uiDialog.addClass( "ui-dialog-buttons" ); + this.uiDialogButtonPane.appendTo( this.uiDialog ); + } else { + this.uiDialog.removeClass( "ui-dialog-buttons" ); } }, _makeDraggable: function() { - var self = this, - options = self.options, - doc = $(document), - heightBeforeDrag; + var that = this, + options = this.options; - function filteredUi(ui) { + function filteredUi( ui ) { return { position: ui.position, offset: ui.offset }; } - 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)); + this.uiDialog.draggable({ + cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", + handle: ".ui-dialog-titlebar", + containment: "document", + start: function( event, ui ) { + $( this ) + .addClass( "ui-dialog-dragging" ); + that._trigger( "dragStart", event, filteredUi( ui ) ); }, - drag: function(event, ui) { - self._trigger('drag', event, filteredUi(ui)); + drag: function( event, ui ) { + that._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 - that.document.scrollLeft(), + ui.position.top - that.document.scrollTop() + ]; + $( this ) + .removeClass( "ui-dialog-dragging" ); + that._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, + var that = this, + options = this.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 = this.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, @@ -467,101 +438,99 @@ $.widget("ui.dialog", { }; } - self.uiDialog.resizable({ - cancel: '.ui-dialog-content', - containment: 'document', - alsoResize: self.element, + this.uiDialog.resizable({ + cancel: ".ui-dialog-content", + containment: "document", + alsoResize: this.element, maxWidth: options.maxWidth, maxHeight: options.maxHeight, minWidth: options.minWidth, - minHeight: self._minHeight(), + minHeight: this._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" ); + that._trigger( "resizeStart", event, filteredUi( ui ) ); }, - resize: function(event, ui) { - self._trigger('resize', event, filteredUi(ui)); + resize: function( event, ui ) { + that._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(); + that._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 - // workaround for jQuery bug #5781 http://dev.jquery.com/ticket/5781 - .css({ top: 0, left: 0 }) - .position($.extend({ of: window }, position)); - if (!isVisible) { + this.uiDialog.position( position ); + if ( !isVisible ) { this.uiDialog.hide(); } }, _setOptions: function( options ) { - var self = this, + var that = this, resizableOptions = {}, resize = false; $.each( options, function( key, value ) { - self._setOption( key, value ); - + that._setOption( key, value ); + if ( key in sizeRelatedOptions ) { resize = true; } @@ -578,104 +547,98 @@ $.widget("ui.dialog", { } }, - _setOption: function(key, value){ - var self = this, - uiDialog = self.uiDialog; - - switch (key) { - //handling of deprecated beforeclose (vs beforeClose) option - //Ticket #4669 http://dev.jqueryui.com/ticket/4669 - //TODO: remove in 1.9pre - case "beforeclose": - key = "beforeClose"; - break; + _setOption: function( key, value ) { + var isDraggable, isResizable, + uiDialog = this.uiDialog; + + switch ( key ) { case "buttons": - self._createButtons(value); + this._createButtons( value ); break; case "closeText": // ensure that we always pass a string - self.uiDialogTitlebarCloseText.text("" + value); + this.uiDialogTitlebarCloseText.text( "" + value ); break; case "dialogClass": uiDialog - .removeClass(self.options.dialogClass) - .addClass(uiDialogClasses + value); + .removeClass( this.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": - var isDraggable = uiDialog.is( ":data(draggable)" ); + isDraggable = uiDialog.is( ":data(draggable)" ); if ( isDraggable && !value ) { uiDialog.draggable( "destroy" ); } - + if ( !isDraggable && value ) { - self._makeDraggable(); + this._makeDraggable(); } break; case "position": - self._position(value); + this._position( value ); break; case "resizable": // currently resizable, becoming non-resizable - var isResizable = uiDialog.is( ":data(resizable)" ); - if (isResizable && !value) { - uiDialog.resizable('destroy'); + isResizable = uiDialog.is( ":data(resizable)" ); + 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 ) { + this._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", this.uiDialogTitlebar ) + .html( "" + ( value || " " ) ); break; } - $.Widget.prototype._setOption.apply(self, arguments); + this._super( key, value ); }, _size: function() { /* If the user has resized the dialog, the .ui-dialog and .ui-dialog-content * divs will both have width and height set, so we need to reset them */ - var options = this.options, - nonContentHeight, - minContentHeight, + var nonContentHeight, minContentHeight, autoHeight, + options = this.options, isVisible = this.uiDialog.is( ":visible" ); // reset content sizing this.element.show().css({ - width: 'auto', + 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(); + .outerHeight(); minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); - + if ( options.height === "auto" ) { // only needed for IE6 support if ( $.support.minHeight ) { @@ -685,7 +648,7 @@ $.widget("ui.dialog", { }); } else { this.uiDialog.show(); - var autoHeight = this.element.css( "height", "auto" ).height(); + autoHeight = this.element.css( "height", "auto" ).height(); if ( !isVisible ) { this.uiDialog.hide(); } @@ -695,102 +658,108 @@ $.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()); + if (this.uiDialog.is( ":data(resizable)" ) ) { + this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); } } }); $.extend($.ui.dialog, { - version: "1.8.22", - uuid: 0, 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); - - // allow closing by pressing the escape key - $(document).bind('keydown.dialog-overlay', function(event) { - if (dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && - event.keyCode === $.ui.keyCode.ESCAPE) { - - dialog.close(event); - event.preventDefault(); - } - }); + }, 1 ); // 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() || $('<div></div>').addClass('ui-widget-overlay')) - .appendTo(document.body) - .css({ - width: this.width(), - height: this.height() - }); + var $el = ( this.oldInstances.pop() || $( "<div>" ).addClass( "ui-widget-overlay" ) ); + + // allow closing by pressing the escape key + $( document ).bind( "keydown.dialog-overlay", function( event ) { + var instances = $.ui.dialog.overlay.instances; + // only react to the event if we're the top overlay + if ( instances.length !== 0 && instances[ instances.length - 1 ] === $el && + dialog.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && + event.keyCode === $.ui.keyCode.ESCAPE ) { + + dialog.close( event ); + event.preventDefault(); + } + }); - if ($.fn.bgiframe) { + $el.appendTo( document.body ).css({ + width: this.width(), + height: this.height() + }); + + 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 ), + maxZ = 0; + + 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(); - + $el.height( 0 ).width( 0 ).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; }, @@ -798,8 +767,8 @@ $.extend($.ui.dialog.overlay, { height: function() { var scrollHeight, offsetHeight; - // handle IE 6 - if ($.browser.msie && $.browser.version < 7) { + // handle IE + if ( $.browser.msie ) { scrollHeight = Math.max( document.documentElement.scrollHeight, document.body.scrollHeight @@ -809,14 +778,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"; } }, @@ -834,14 +803,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"; } }, @@ -854,9 +823,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({ @@ -869,10 +838,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 ) ); Modified: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.draggable.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.draggable.js?rev=1398771&r1=1398770&r2=1398771&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.draggable.js (original) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.draggable.js Tue Oct 16 12:57:46 2012 @@ -1,11 +1,12 @@ /*! - * jQuery UI Draggable 1.8.22 + * jQuery UI Draggable 1.9.0 + * http://jqueryui.com * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Draggables + * http://api.jqueryui.com/draggable/ * * Depends: * jquery.ui.core.js @@ -15,6 +16,7 @@ (function( $, undefined ) { $.widget("ui.draggable", $.ui.mouse, { + version: "1.9.0", widgetEventPrefix: "drag", options: { addClasses: true, @@ -54,17 +56,9 @@ $.widget("ui.draggable", $.ui.mouse, { }, - destroy: function() { - if(!this.element.data('draggable')) return; - this.element - .removeData("draggable") - .unbind(".draggable") - .removeClass("ui-draggable" - + " ui-draggable-dragging" - + " ui-draggable-disabled"); + _destroy: function() { + this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); this._mouseDestroy(); - - return this; }, _mouseCapture: function(event) { @@ -80,17 +74,15 @@ $.widget("ui.draggable", $.ui.mouse, { if (!this.handle) return false; - if ( o.iframeFix ) { - $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { - $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') - .css({ - width: this.offsetWidth+"px", height: this.offsetHeight+"px", - position: "absolute", opacity: "0.001", zIndex: 1000 - }) - .css($(this).offset()) - .appendTo("body"); - }); - } + $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() { + $('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>') + .css({ + width: this.offsetWidth+"px", height: this.offsetHeight+"px", + position: "absolute", opacity: "0.001", zIndex: 1000 + }) + .css($(this).offset()) + .appendTo("body"); + }); return true; @@ -221,10 +213,10 @@ $.widget("ui.draggable", $.ui.mouse, { 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))) { - var self = this; + var that = this; $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() { - if(self._trigger("stop", event) !== false) { - self._clear(); + if(that._trigger("stop", event) !== false) { + that._clear(); } }); } else { @@ -237,11 +229,10 @@ $.widget("ui.draggable", $.ui.mouse, { }, _mouseUp: function(event) { - if (this.options.iframeFix === true) { - $("div.ui-draggable-iframeFix").each(function() { - this.parentNode.removeChild(this); - }); //Remove frame helpers - } + //Remove frame helpers + $("div.ui-draggable-iframeFix").each(function() { + this.parentNode.removeChild(this); + }); //If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003) if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event); @@ -321,7 +312,7 @@ $.widget("ui.draggable", $.ui.mouse, { // 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that // the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag - if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) { + if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) { po.left += this.scrollParent.scrollLeft(); po.top += this.scrollParent.scrollTop(); } @@ -379,7 +370,7 @@ $.widget("ui.draggable", $.ui.mouse, { ]; if(!(/^(document|window|parent)$/).test(o.containment) && o.containment.constructor != Array) { - var c = $(o.containment); + var c = $(o.containment); var ce = c[0]; if(!ce) return; var co = c.offset(); var over = ($(ce).css("overflow") != 'hidden'); @@ -402,20 +393,20 @@ $.widget("ui.draggable", $.ui.mouse, { if(!pos) pos = this.position; var mod = d == "absolute" ? 1 : -1; - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); return { top: ( pos.top // The absolute mouse position + this.offset.relative.top * mod // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.top * mod // The offsetParent's offset without borders (offset + border) - - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod) ), left: ( pos.left // The absolute mouse position + this.offset.relative.left * mod // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.parent.left * mod // The offsetParent's offset without borders (offset + border) - - ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) + - ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod) ) }; @@ -423,7 +414,7 @@ $.widget("ui.draggable", $.ui.mouse, { _generatePosition: function(event) { - var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); + var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName); var pageX = event.pageX; var pageY = event.pageY; @@ -433,18 +424,18 @@ $.widget("ui.draggable", $.ui.mouse, { */ if(this.originalPosition) { //If we are not dragging yet, we won't check for options - var containment; - if(this.containment) { - if (this.relative_container){ - var co = this.relative_container.offset(); - containment = [ this.containment[0] + co.left, - this.containment[1] + co.top, - this.containment[2] + co.left, - this.containment[3] + co.top ]; - } - else { - containment = this.containment; - } + var containment; + if(this.containment) { + if (this.relative_container){ + var co = this.relative_container.offset(); + containment = [ this.containment[0] + co.left, + this.containment[1] + co.top, + this.containment[2] + co.left, + this.containment[3] + co.top ]; + } + else { + containment = this.containment; + } if(event.pageX - this.offset.click.left < containment[0]) pageX = containment[0] + this.offset.click.left; if(event.pageY - this.offset.click.top < containment[1]) pageY = containment[1] + this.offset.click.top; @@ -469,14 +460,14 @@ $.widget("ui.draggable", $.ui.mouse, { - this.offset.click.top // Click offset (relative to the element) - this.offset.relative.top // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.parent.top // The offsetParent's offset without borders (offset + border) - + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) )) ), left: ( pageX // The absolute mouse position - this.offset.click.left // Click offset (relative to the element) - this.offset.relative.left // Only for relative positioned nodes: Relative offset from element to offset parent - this.offset.parent.left // The offsetParent's offset without borders (offset + border) - + ($.browser.safari && $.browser.version < 526 && this.cssPosition == 'fixed' ? 0 : ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) + + ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() )) ) }; @@ -512,10 +503,6 @@ $.widget("ui.draggable", $.ui.mouse, { }); -$.extend($.ui.draggable, { - version: "1.8.22" -}); - $.ui.plugin.add("draggable", "connectToSortable", { start: function(event, ui) { @@ -571,7 +558,7 @@ $.ui.plugin.add("draggable", "connectToS }, drag: function(event, ui) { - var inst = $(this).data("draggable"), self = this; + var inst = $(this).data("draggable"), that = this; var checkPos = function(o) { var dyClick = this.offset.click.top, dxClick = this.offset.click.left; @@ -598,7 +585,7 @@ $.ui.plugin.add("draggable", "connectToS //Now we fake the start of dragging for the sortable instance, //by cloning the list group item, appending it to the sortable and using it as inst.currentItem //We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one) - this.instance.currentItem = $(self).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); + this.instance.currentItem = $(that).clone().removeAttr('id').appendTo(this.instance.element).data("sortable-item", true); this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it this.instance.options.helper = function() { return ui.helper[0]; }; Modified: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.droppable.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.droppable.js?rev=1398771&r1=1398770&r2=1398771&view=diff ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.droppable.js (original) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.droppable.js Tue Oct 16 12:57:46 2012 @@ -1,11 +1,12 @@ /*! - * jQuery UI Droppable 1.8.22 + * jQuery UI Droppable 1.9.0 + * http://jqueryui.com * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * - * http://docs.jquery.com/UI/Droppables + * http://api.jqueryui.com/droppable/ * * Depends: * jquery.ui.core.js @@ -16,6 +17,7 @@ (function( $, undefined ) { $.widget("ui.droppable", { + version: "1.9.0", widgetEventPrefix: "drop", options: { accept: '*', @@ -46,18 +48,13 @@ $.widget("ui.droppable", { }, - destroy: function() { + _destroy: function() { var drop = $.ui.ddmanager.droppables[this.options.scope]; for ( var i = 0; i < drop.length; i++ ) if ( drop[i] == this ) drop.splice(i, 1); - this.element - .removeClass("ui-droppable ui-droppable-disabled") - .removeData("droppable") - .unbind(".droppable"); - - return this; + this.element.removeClass("ui-droppable ui-droppable-disabled"); }, _setOption: function(key, value) { @@ -146,10 +143,6 @@ $.widget("ui.droppable", { }); -$.extend($.ui.droppable, { - version: "1.8.22" -}); - $.ui.intersect = function(draggable, droppable, toleranceMode) { if (!droppable.offset) return false; @@ -240,7 +233,7 @@ $.ui.ddmanager = { }, dragStart: function( draggable, event ) { //Listen for scrolling so that if the dragging causes scrolling the position of the droppables can be recalculated (see #5003) - draggable.element.parents( ":not(body,html)" ).bind( "scroll.droppable", function() { + draggable.element.parentsUntil( "body" ).bind( "scroll.droppable", function() { if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); }); }, @@ -260,7 +253,12 @@ $.ui.ddmanager = { var parentInstance; if (this.options.greedy) { - var parent = this.element.parents(':data(droppable):eq(0)'); + // find droppable parents with same scope + var scope = this.options.scope; + var parent = this.element.parents(':data(droppable)').filter(function () { + return $.data(this, 'droppable').options.scope === scope; + }); + if (parent.length) { parentInstance = $.data(parent[0], 'droppable'); parentInstance.greedyChild = (c == 'isover' ? 1 : 0); @@ -287,7 +285,7 @@ $.ui.ddmanager = { }, dragStop: function( draggable, event ) { - draggable.element.parents( ":not(body,html)" ).unbind( "scroll.droppable" ); + draggable.element.parentsUntil( "body" ).unbind( "scroll.droppable" ); //Call prepareOffsets one final time since IE does not fire return scroll events when overflow was caused by drag (see #5003) if( !draggable.options.refreshPositions ) $.ui.ddmanager.prepareOffsets( draggable, event ); } Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-blind.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-blind.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-blind.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-blind.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,82 @@ +/*! + * jQuery UI Effects Blind 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/blind-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +var rvertical = /up|down|vertical/, + rpositivemotion = /up|left|vertical|horizontal/; + +$.effects.effect.blind = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + direction = o.direction || "up", + vertical = rvertical.test( direction ), + ref = vertical ? "height" : "width", + ref2 = vertical ? "top" : "left", + motion = rpositivemotion.test( direction ), + animation = {}, + show = mode === "show", + wrapper, distance, margin; + + // if already wrapped, the wrapper's properties are my property. #6245 + if ( el.parent().is( ".ui-effects-wrapper" ) ) { + $.effects.save( el.parent(), props ); + } else { + $.effects.save( el, props ); + } + el.show(); + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + distance = wrapper[ ref ](); + margin = parseFloat( wrapper.css( ref2 ) ) || 0; + + animation[ ref ] = show ? distance : 0; + if ( !motion ) { + el + .css( vertical ? "bottom" : "right", 0 ) + .css( vertical ? "top" : "left", "auto" ) + .css({ position: "absolute" }); + + animation[ ref2 ] = show ? margin : distance + margin; + } + + // start at 0 if we are showing + if ( show ) { + wrapper.css( ref, 0 ); + if ( ! motion ) { + wrapper.css( ref2, margin + distance ); + } + } + + // Animate + wrapper.animate( animation, { + duration: o.duration, + easing: o.easing, + queue: false, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-blind.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-bounce.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-bounce.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-bounce.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-bounce.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,113 @@ +/*! + * jQuery UI Effects Bounce 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/bounce-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.bounce = function( o, done ) { + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + + // defaults: + mode = $.effects.setMode( el, o.mode || "effect" ), + hide = mode === "hide", + show = mode === "show", + direction = o.direction || "up", + distance = o.distance, + times = o.times || 5, + + // number of internal animations + anims = times * 2 + ( show || hide ? 1 : 0 ), + speed = o.duration / anims, + easing = o.easing, + + // utility: + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ), + i, + upAnim, + downAnim, + + // we will need to re-assemble the queue to stack our animations in place + queue = el.queue(), + queuelen = queue.length; + + // Avoid touching opacity to prevent clearType and PNG issues in IE + if ( show || hide ) { + props.push( "opacity" ); + } + + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); // Create Wrapper + + // default distance for the BIGGEST bounce is the outer Distance / 3 + if ( !distance ) { + distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; + } + + if ( show ) { + downAnim = { opacity: 1 }; + downAnim[ ref ] = 0; + + // if we are showing, force opacity 0 and set the initial position + // then do the "first" animation + el.css( "opacity", 0 ) + .css( ref, motion ? -distance * 2 : distance * 2 ) + .animate( downAnim, speed, easing ); + } + + // start at the smallest distance if we are hiding + if ( hide ) { + distance = distance / Math.pow( 2, times - 1 ); + } + + downAnim = {}; + downAnim[ ref ] = 0; + // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here + for ( i = 0; i < times; i++ ) { + upAnim = {}; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + el.animate( upAnim, speed, easing ) + .animate( downAnim, speed, easing ); + + distance = hide ? distance * 2 : distance / 2; + } + + // Last Bounce when Hiding + if ( hide ) { + upAnim = { opacity: 0 }; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + el.animate( upAnim, speed, easing ); + } + + el.queue(function() { + if ( hide ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + + // inject all the animations we just queued to be first in line (after "inprogress") + if ( queuelen > 1) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + el.dequeue(); + +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-bounce.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-clip.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-clip.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-clip.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-clip.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,67 @@ +/*! + * jQuery UI Effects Clip 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/clip-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.clip = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "vertical", + vert = direction === "vertical", + size = vert ? "height" : "width", + position = vert ? "top" : "left", + animation = {}, + wrapper, animate, distance; + + // Save & Show + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + animate = ( el[0].tagName === "IMG" ) ? wrapper : el; + distance = animate[ size ](); + + // Shift + if ( show ) { + animate.css( size, 0 ); + animate.css( position, distance / 2 ); + } + + // Create Animation Object: + animation[ size ] = show ? distance : 0; + animation[ position ] = show ? 0 : distance / 2; + + // Animate + animate.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( !show ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); + +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-clip.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-drop.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-drop.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-drop.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-drop.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,65 @@ +/*! + * jQuery UI Effects Drop 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/drop-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.drop = function( o, done ) { + + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "opacity", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + direction = o.direction || "left", + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ) ? "pos" : "neg", + animation = { + opacity: show ? 1 : 0 + }, + distance; + + // Adjust + $.effects.save( el, props ); + el.show(); + $.effects.createWrapper( el ); + + distance = o.distance || el[ ref === "top" ? "outerHeight": "outerWidth" ]( true ) / 2; + + if ( show ) { + el + .css( "opacity", 0 ) + .css( ref, motion === "pos" ? -distance : distance ); + } + + // Animation + animation[ ref ] = ( show ? + ( motion === "pos" ? "+=" : "-=" ) : + ( motion === "pos" ? "-=" : "+=" ) ) + + distance; + + // Animate + el.animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + } + }); +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-drop.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-explode.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-explode.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-explode.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-explode.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,97 @@ +/*! + * jQuery UI Effects Explode 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/explode-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.explode = function( o, done ) { + + var rows = o.pieces ? Math.round( Math.sqrt( o.pieces ) ) : 3, + cells = rows, + el = $( this ), + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + + // show and then visibility:hidden the element before calculating offset + offset = el.show().css( "visibility", "hidden" ).offset(), + + // width and height of a piece + width = Math.ceil( el.outerWidth() / cells ), + height = Math.ceil( el.outerHeight() / rows ), + pieces = [], + + // loop + i, j, left, top, mx, my; + + // children animate complete: + function childComplete() { + pieces.push( this ); + if ( pieces.length === rows * cells ) { + animComplete(); + } + } + + // clone the element for each row and cell. + for( i = 0; i < rows ; i++ ) { // ===> + top = offset.top + i * height; + my = i - ( rows - 1 ) / 2 ; + + for( j = 0; j < cells ; j++ ) { // ||| + left = offset.left + j * width; + mx = j - ( cells - 1 ) / 2 ; + + // Create a clone of the now hidden main element that will be absolute positioned + // within a wrapper div off the -left and -top equal to size of our pieces + el + .clone() + .appendTo( "body" ) + .wrap( "<div></div>" ) + .css({ + position: "absolute", + visibility: "visible", + left: -j * width, + top: -i * height + }) + + // select the wrapper - make it overflow: hidden and absolute positioned based on + // where the original was located +left and +top equal to the size of pieces + .parent() + .addClass( "ui-effects-explode" ) + .css({ + position: "absolute", + overflow: "hidden", + width: width, + height: height, + left: left + ( show ? mx * width : 0 ), + top: top + ( show ? my * height : 0 ), + opacity: show ? 0 : 1 + }).animate({ + left: left + ( show ? 0 : mx * width ), + top: top + ( show ? 0 : my * height ), + opacity: show ? 1 : 0 + }, o.duration || 500, o.easing, childComplete ); + } + } + + function animComplete() { + el.css({ + visibility: "visible" + }); + $( pieces ).remove(); + if ( !show ) { + el.hide(); + } + done(); + } +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-explode.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fade.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fade.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fade.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fade.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,30 @@ +/*! + * jQuery UI Effects Fade 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/fade-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.fade = function( o, done ) { + var el = $( this ), + mode = $.effects.setMode( el, o.mode || "toggle" ); + + el.animate({ + opacity: mode + }, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: done + }); +}; + +})( jQuery ); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fade.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fold.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fold.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fold.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fold.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,76 @@ +/*! + * jQuery UI Effects Fold 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/fold-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.fold = function( o, done ) { + + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.effects.setMode( el, o.mode || "hide" ), + show = mode === "show", + hide = mode === "hide", + size = o.size || 15, + percent = /([0-9]+)%/.exec( size ), + horizFirst = !!o.horizFirst, + widthFirst = show !== horizFirst, + ref = widthFirst ? [ "width", "height" ] : [ "height", "width" ], + duration = o.duration / 2, + wrapper, distance, + animation1 = {}, + animation2 = {}; + + $.effects.save( el, props ); + el.show(); + + // Create Wrapper + wrapper = $.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + distance = widthFirst ? + [ wrapper.width(), wrapper.height() ] : + [ wrapper.height(), wrapper.width() ]; + + if ( percent ) { + size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; + } + if ( show ) { + wrapper.css( horizFirst ? { + height: 0, + width: size + } : { + height: size, + width: 0 + }); + } + + // Animation + animation1[ ref[ 0 ] ] = show ? distance[ 0 ] : size; + animation2[ ref[ 1 ] ] = show ? distance[ 1 ] : 0; + + // Animate + wrapper + .animate( animation1, duration, o.easing ) + .animate( animation2, duration, o.easing, function() { + if ( hide ) { + el.hide(); + } + $.effects.restore( el, props ); + $.effects.removeWrapper( el ); + done(); + }); + +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-fold.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-highlight.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-highlight.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-highlight.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-highlight.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,50 @@ +/*! + * jQuery UI Effects Highlight 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/highlight-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.highlight = function( o, done ) { + var elem = $( this ), + props = [ "backgroundImage", "backgroundColor", "opacity" ], + mode = $.effects.setMode( elem, o.mode || "show" ), + animation = { + backgroundColor: elem.css( "backgroundColor" ) + }; + + if (mode === "hide") { + animation.opacity = 0; + } + + $.effects.save( elem, props ); + + elem + .show() + .css({ + backgroundImage: "none", + backgroundColor: o.color || "#ffff99" + }) + .animate( animation, { + queue: false, + duration: o.duration, + easing: o.easing, + complete: function() { + if ( mode === "hide" ) { + elem.hide(); + } + $.effects.restore( elem, props ); + done(); + } + }); +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-highlight.js ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-pulsate.js URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-pulsate.js?rev=1398771&view=auto ============================================================================== --- ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-pulsate.js (added) +++ ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-pulsate.js Tue Oct 16 12:57:46 2012 @@ -0,0 +1,63 @@ +/*! + * jQuery UI Effects Pulsate 1.9.0 + * http://jqueryui.com + * + * Copyright 2012 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/pulsate-effect/ + * + * Depends: + * jquery.ui.effect.js + */ +(function( $, undefined ) { + +$.effects.effect.pulsate = function( o, done ) { + var elem = $( this ), + mode = $.effects.setMode( elem, o.mode || "show" ), + show = mode === "show", + hide = mode === "hide", + showhide = ( show || mode === "hide" ), + + // showing or hiding leaves of the "last" animation + anims = ( ( o.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), + duration = o.duration / anims, + animateTo = 0, + queue = elem.queue(), + queuelen = queue.length, + i; + + if ( show || !elem.is(":visible")) { + elem.css( "opacity", 0 ).show(); + animateTo = 1; + } + + // anims - 1 opacity "toggles" + for ( i = 1; i < anims; i++ ) { + elem.animate({ + opacity: animateTo + }, duration, o.easing ); + animateTo = 1 - animateTo; + } + + elem.animate({ + opacity: animateTo + }, duration, o.easing); + + elem.queue(function() { + if ( hide ) { + elem.hide(); + } + done(); + }); + + // We just queued up "anims" animations, we need to put them next in the queue + if ( queuelen > 1 ) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); + } + elem.dequeue(); +}; + +})(jQuery); Propchange: ofbiz/trunk/framework/images/webapp/images/jquery/ui/development-bundle/ui/jquery.ui.effect-pulsate.js ------------------------------------------------------------------------------ svn:mime-type = text/plain |
| Free forum by Nabble | Edit this page |
