70% OFF : CLICK HERE TO BUY IT TODAY FOR ONLY $44.70 OR GET IT FREE VIA TRIALPAY  

PHP Demo Application - Source Code

/Framework/Model/Vendor/jquery-ui/development-bundle/ui/jquery.ui.resizable.js



/*
 * jQuery UI Resizable 1.8.4
 *
 * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * http://docs.jquery.com/UI/Resizables
 *
 * Depends:
 *    jquery.ui.core.js
 *    jquery.ui.mouse.js
 *    jquery.ui.widget.js
 */
(function( $, undefined ) {
	$.widget("ui.resizable", $.ui.mouse, {
		    widgetEventPrefix"resize",
		    options: {
			        alsoResizefalse,
			        animatefalse,
			        animateDuration"slow",
			        animateEasing"swing",
			        aspectRatiofalse,
			        autoHidefalse,
			        containmentfalse,
			        ghostfalse,
			        gridfalse,
			        handles"e,s,se",
			        helperfalse,
			        maxHeightnull,
			        maxWidthnull,
			        minHeight10,
			        minWidth10,
			        zIndex1000
			    },
		    _create: function() {
			        var self thisthis.options;
			        this.element.addClass("ui-resizable");
			        $.extend(this, {
				            _aspectRatio: !!(o.aspectRatio),
				            aspectRatioo.aspectRatio,
				            originalElementthis.element,
				            _proportionallyResizeElements[],
				            _helpero.helper || o.ghost || o.animate o.helper || 'ui-resizable-helper' null
				        });
			        //Wrap the element if it cannot hold child nodes
			        if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
				            //Opera fix for relative positioning
				            if (/relative/.test(this.element.css('position')) && $.browser.opera)
				                this.element.css({ position'relative'top'auto'left'auto'
					});
				            //Create a wrapper element and set the wrapper to the new current internal element
				            this.element.wrap(
				                $('<div class="ui-wrapper" style="overflow: hidden;
				"></div>').css({
					                    positionthis.element.css('position'),
					                    widththis.element.outerWidth(),
					                    heightthis.element.outerHeight(),
					                    topthis.element.css('top'),
					                    leftthis.element.css('left')
					                })
				            );
				            //Overwrite the original this.element
				            this.element this.element.parent().data(
				                "resizable"this.element.data('resizable')
				            );
				            this.elementIsWrapper true;
				            //Move margins to the wrapper
				            this.element.css({ marginLeftthis.originalElement.css("marginLeft"), marginTopthis.originalElement.css("marginTop"), marginRightthis.originalElement.css("marginRight"), marginBottomthis.originalElement.css("marginBottom")
					});
				            this.originalElement.css({ marginLeft0marginTop0marginRight0marginBottom0});
				            //Prevent Safari textarea resize
				            this.originalResizeStyle this.originalElement.css('resize');
				            this.originalElement.css('resize''none');
				            //Push the actual element to our proportionallyResize internal array
				            this._proportionallyResizeElements.push(this.originalElement.css({ position'static'zoom1display'block'
					}));
				            // avoid IE jump (hard set the margin)
				            this.originalElement.css({ marginthis.originalElement.css('margin')
					});
				            // fix handlers offset
				            this._proportionallyResize();
				        }
			        this.handles o.handles || (!$('.ui-resizable-handle'this.element).length "e,s,se" : { n'.ui-resizable-n'e'.ui-resizable-e's'.ui-resizable-s'w'.ui-resizable-w'se'.ui-resizable-se'sw'.ui-resizable-sw'ne'.ui-resizable-ne'nw'.ui-resizable-nw'
				});
			        if(this.handles.constructor == String) {
				            if(this.handles == 'all'this.handles 'n,e,s,w,se,sw,ne,nw';
				            var this.handles.split(",");
				 this.handles {};
				            for(var 0;
				 n.length;
				 i++) {
					                var handle = $.trim(n[i]), hname 'ui-resizable-'+handle;
					                var axis = $('<div class="ui-resizable-handle ' hname '"></div>');
					                // increase zIndex of sw, se, ne, nw axis
					                //TODO : this modifies original option
					                if(/sw|se|ne|nw/.test(handle)) axis.css({ zIndex: ++o.zIndex
						});
					                //TODO : What's going on here?
					                if ('se' == handle) {
						                    axis.addClass('ui-icon ui-icon-gripsmall-diagonal-se');
						                };
					                //Insert into internal handles object and append to element
					                this.handles[handle] = '.ui-resizable-'+handle;
					                this.element.append(axis);
					            }
				        }
			        this._renderAxis = function(target) {
				            target target || this.element;
				            for(var i in this.handles) {
					                if(this.handles[i].constructor == String)
					                    this.handles[i] = $(this.handles[i], this.element).show();
					                //Apply pad to wrapper element, needed to fix axis position (textarea, inputs, scrolls)
					                if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
						                    var axis = $(this.handles[i], this.element), padWrapper 0;
						                    //Checking the correct pad and border
						                    padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
						                    //The padding type i have to apply...
						                    var padPos = [ 'padding',
						                        /ne|nw|n/.test(i) ? 'Top' :
						                        /se|sw|s/.test(i) ? 'Bottom' :
						                        /^e$/.test(i) ? 'Right' 'Left' ].join("");
						                    target.css(padPospadWrapper);
						                    this._proportionallyResize();
						                }
					                //TODO: What's that good for? There's not anything to be executed left
					                if(!$(this.handles[i]).length)
					                    continue;
					            }
				        };
			        //TODO: make renderAxis a prototype function
			        this._renderAxis(this.element);
			        this._handles = $('.ui-resizable-handle'this.element)
			            .disableSelection();
			        //Matching axis name
			        this._handles.mouseover(function() {
				            if (!self.resizing) {
					                if (this.className)
					                    var axis this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);
					                //Axis, default = se
					                self.axis axis && axis[1] ? axis[1] : 'se';
					            }
				        });
			        //If we want to auto hide the elements
			        if (o.autoHide) {
				            this._handles.hide();
				            $(this.element)
				                .addClass("ui-resizable-autohide")
				                .hover(function() {
					                    $(this).removeClass("ui-resizable-autohide");
					                    self._handles.show();
					                },
				                function(){
					                    if (!self.resizing) {
						                        $(this).addClass("ui-resizable-autohide");
						                        self._handles.hide();
						                    }
					                });
				        }
			        //Initialize the mouse interaction
			        this._mouseInit();
			    },
		    destroy: function() {
			        this._mouseDestroy();
			        var _destroy = function(exp) {
				            $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing")
				                .removeData("resizable").unbind(".resizable").find('.ui-resizable-handle').remove();
				        };
			        //TODO: Unwrap at same DOM position
			        if (this.elementIsWrapper) {
				            _destroy(this.element);
				            var wrapper this.element;
				            wrapper.after(
				                this.originalElement.css({
					                    positionwrapper.css('position'),
					                    widthwrapper.outerWidth(),
					                    heightwrapper.outerHeight(),
					                    topwrapper.css('top'),
					                    leftwrapper.css('left')
					                })
				            ).remove();
				        }
			        this.originalElement.css('resize'this.originalResizeStyle);
			        _destroy(this.originalElement);
			        return this;
			    },
		    _mouseCapture: function(event) {
			        var handle false;
			        for (var i in this.handles) {
				            if ($(this.handles[i])[0] == event.target) {
					                handle true;
					            }
				        }
			        return !this.options.disabled && handle;
			    },
		    _mouseStart: function(event) {
			        var this.optionsiniPos this.element.position(), el this.element;
			        this.resizing true;
			        this.documentScroll = { top: $(document).scrollTop(), left: $(document).scrollLeft()
				};
			        // bugfix for http://dev.jquery.com/ticket/1749
			        if (el.is('.ui-draggable') || (/absolute/).test(el.css('position'))) {
				            el.css({ position'absolute'topiniPos.topleftiniPos.left
					});
				        }
			        //Opera fixing relative position
			        if ($.browser.opera && (/relative/).test(el.css('position')))
			            el.css({ position'relative'top'auto'left'auto'
				});
			        this._renderProxy();
			        var curleft num(this.helper.css('left')), curtop num(this.helper.css('top'));
			        if (o.containment) {
				            curleft += $(o.containment).scrollLeft() || 0;
				            curtop += $(o.containment).scrollTop() || 0;
				        }
			        //Store needed variables
			        this.offset this.helper.offset();
			        this.position = { leftcurlefttopcurtop
				};
			        this.size this._helper ? { widthel.outerWidth(), heightel.outerHeight()
				} : { widthel.width(), heightel.height()
				};
			        this.originalSize this._helper ? { widthel.outerWidth(), heightel.outerHeight()
				} : { widthel.width(), heightel.height()
				};
			        this.originalPosition = { leftcurlefttopcurtop
				};
			        this.sizeDiff = { widthel.outerWidth() - el.width(), heightel.outerHeight() - el.height()
				};
			        this.originalMousePosition = { leftevent.pageXtopevent.pageY
				};
			        //Aspect Ratio
			        this.aspectRatio = (typeof o.aspectRatio == 'number') ? o.aspectRatio : ((this.originalSize.width this.originalSize.height) || 1);
			        var cursor = $('.ui-resizable-' this.axis).css('cursor');
			        $('body').css('cursor'cursor == 'auto' this.axis '-resize' cursor);
			        el.addClass("ui-resizable-resizing");
			        this._propagate("start"event);
			        return true;
			    },
		    _mouseDrag: function(event) {
			        //Increase performance, avoid regex
			        var el this.helperthis.optionsprops {},
			            self thissmp this.originalMousePositionthis.axis;
			        var dx = (event.pageX-smp.left)||0dy = (event.pageY-smp.top)||0;
			        var trigger this._change[a];
			        if (!trigger) return false;
			        // Calculate the attrs that will be change
			        var data trigger.apply(this, [eventdxdy]), ie6 = $.browser.msie && $.browser.version 7csdif this.sizeDiff;
			        if (this._aspectRatio || event.shiftKey)
			            data this._updateRatio(dataevent);
			        data this._respectSize(dataevent);
			        // plugins callbacks need to be called first
			        this._propagate("resize"event);
			        el.css({
				            topthis.position.top "px"leftthis.position.left "px",
				            widththis.size.width "px"heightthis.size.height "px"
				        });
			        if (!this._helper && this._proportionallyResizeElements.length)
			            this._proportionallyResize();
			        this._updateCache(data);
			        // calling the user callback at the end
			        this._trigger('resize'eventthis.ui());
			        return false;
			    },
		    _mouseStop: function(event) {
			        this.resizing false;
			        var this.optionsself this;
			        if(this._helper) {
				            var pr this._proportionallyResizeElementsista pr.length && (/textarea/i).test(pr[0].nodeName),
				                        soffseth ista && $.ui.hasScroll(pr[0], 'left'/* TODO - jump height */ self.sizeDiff.height,
				                            soffsetw ista self.sizeDiff.width;
				            var = { width: (self.size.width soffsetw), height: (self.size.height soffseth)
					},
				                left = (parseInt(self.element.css('left'), 10) + (self.position.left self.originalPosition.left)) || null,
				                top = (parseInt(self.element.css('top'), 10) + (self.position.top self.originalPosition.top)) || null;
				            if (!o.animate)
				                this.element.css($.extend(s, { toptopleftleft
					}));
				            self.helper.height(self.size.height);
				            self.helper.width(self.size.width);
				            if (this._helper && !o.animatethis._proportionallyResize();
				        }
			        $('body').css('cursor''auto');
			        this.element.removeClass("ui-resizable-resizing");
			        this._propagate("stop"event);
			        if (this._helperthis.helper.remove();
			        return false;
			    },
		    _updateCache: function(data) {
			        var this.options;
			        this.offset this.helper.offset();
			        if (isNumber(data.left)) this.position.left data.left;
			        if (isNumber(data.top)) this.position.top data.top;
			        if (isNumber(data.height)) this.size.height data.height;
			        if (isNumber(data.width)) this.size.width data.width;
			    },
		    _updateRatio: function(dataevent) {
			        var this.optionscpos this.positioncsize this.sizethis.axis;
			        if (data.heightdata.width = (csize.height this.aspectRatio);
			        else if (data.widthdata.height = (csize.width this.aspectRatio);
			        if (== 'sw') {
				            data.left cpos.left + (csize.width data.width);
				            data.top null;
				        }
			        if (== 'nw') {
				            data.top cpos.top + (csize.height data.height);
				            data.left cpos.left + (csize.width data.width);
				        }
			        return data;
			    },
		    _respectSize: function(dataevent) {
			        var el this.helperthis.optionspRatio this._aspectRatio || event.shiftKeythis.axis,
			                ismaxw isNumber(data.width) && o.maxWidth && (o.maxWidth data.width), ismaxh isNumber(data.height) && o.maxHeight && (o.maxHeight data.height),
			                    isminw isNumber(data.width) && o.minWidth && (o.minWidth data.width), isminh isNumber(data.height) && o.minHeight && (o.minHeight data.height);
			        if (isminwdata.width o.minWidth;
			        if (isminhdata.height o.minHeight;
			        if (ismaxwdata.width o.maxWidth;
			        if (ismaxhdata.height o.maxHeight;
			        var dw this.originalPosition.left this.originalSize.widthdh this.position.top this.size.height;
			        var cw = /sw|nw|w/.test(a), ch = /nw|ne|n/.test(a);
			        if (isminw && cwdata.left dw o.minWidth;
			        if (ismaxw && cwdata.left dw o.maxWidth;
			        if (isminh && ch)    data.top dh o.minHeight;
			        if (ismaxh && ch)    data.top dh o.maxHeight;
			        // fixing jump error on top/left - bug #2330
			        var isNotwh = !data.width && !data.height;
			        if (isNotwh && !data.left && data.topdata.top null;
			        else if (isNotwh && !data.top && data.leftdata.left null;
			        return data;
			    },
		    _proportionallyResize: function() {
			        var this.options;
			        if (!this._proportionallyResizeElements.length) return;
			        var element this.helper || this.element;
			        for (var i=0;
			 this._proportionallyResizeElements.length;
			 i++) {
				            var prel this._proportionallyResizeElements[i];
				            if (!this.borderDif) {
					                var = [prel.css('borderTopWidth'), prel.css('borderRightWidth'), prel.css('borderBottomWidth'), prel.css('borderLeftWidth')],
					                    = [prel.css('paddingTop'), prel.css('paddingRight'), prel.css('paddingBottom'), prel.css('paddingLeft')];
					                this.borderDif = $.map(b, function(vi) {
						                    var border parseInt(v,10)||0padding parseInt(p[i],10)||0;
						                    return border padding;
						                });
					            }
				            if ($.browser.msie && !(!($(element).is(':hidden') || $(element).parents(':hidden').length)))
				                continue;
				            prel.css({
					                height: (element.height() - this.borderDif[0] - this.borderDif[2]) || 0,
					                width: (element.width() - this.borderDif[1] - this.borderDif[3]) || 0
					            });
				        };
			    },
		    _renderProxy: function() {
			        var el this.elementthis.options;
			        this.elementOffset el.offset();
			        if(this._helper) {
				            this.helper this.helper || $('<div style="overflow:hidden;
				"></div>');
				            // fix ie6 offset TODO: This seems broken
				            var ie6 = $.browser.msie && $.browser.version 7ie6offset = (ie6 0),
				            pxyoffset = ( ie6 : -);
				            this.helper.addClass(this._helper).css({
					                widththis.element.outerWidth() + pxyoffset,
					                heightthis.element.outerHeight() + pxyoffset,
					                position'absolute',
					                leftthis.elementOffset.left ie6offset +'px',
					                topthis.elementOffset.top ie6offset +'px',
					                zIndex: ++o.zIndex //TODO: Don't modify option
					            });
				            this.helper
				                .appendTo("body")
				                .disableSelection();
				        } else {
				            this.helper this.element;
				        }
			    },
		    _change: {
			        e: function(eventdxdy) {
				            return { widththis.originalSize.width dx
					};
				        },
			        w: function(eventdxdy) {
				            var this.optionscs this.originalSizesp this.originalPosition;
				            return { leftsp.left dxwidthcs.width dx
					};
				        },
			        n: function(eventdxdy) {
				            var this.optionscs this.originalSizesp this.originalPosition;
				            return { topsp.top dyheightcs.height dy
					};
				        },
			        s: function(eventdxdy) {
				            return { heightthis.originalSize.height dy
					};
				        },
			        se: function(eventdxdy) {
				            return $.extend(this._change.s.apply(thisarguments), this._change.e.apply(this, [eventdxdy]));
				        },
			        sw: function(eventdxdy) {
				            return $.extend(this._change.s.apply(thisarguments), this._change.w.apply(this, [eventdxdy]));
				        },
			        ne: function(eventdxdy) {
				            return $.extend(this._change.n.apply(thisarguments), this._change.e.apply(this, [eventdxdy]));
				        },
			        nw: function(eventdxdy) {
				            return $.extend(this._change.n.apply(thisarguments), this._change.w.apply(this, [eventdxdy]));
				        }
			    },
		    _propagate: function(nevent) {
			        $.ui.plugin.call(thisn, [eventthis.ui()]);
			        (!= "resize" && this._trigger(neventthis.ui()));
			    },
		    plugins{},
		    ui: function() {
			        return {
				            originalElementthis.originalElement,
				            elementthis.element,
				            helperthis.helper,
				            positionthis.position,
				            sizethis.size,
				            originalSizethis.originalSize,
				            originalPositionthis.originalPosition
				        };
			    }
		});
	$.extend($.ui.resizable, {
		    version"1.8.4"
		});
	/*
	 * Resizable Extensions
	 */
	$.ui.plugin.add("resizable""alsoResize", {
		    start: function (eventui) {
			        var self = $(this).data("resizable"), self.options;
			        var _store = function (exp) {
				            $(exp).each(function() {
					                var el = $(this);
					                el.data("resizable-alsoresize", {
						                    widthparseInt(el.width(), 10), heightparseInt(el.height(), 10),
						                    leftparseInt(el.css('left'), 10), topparseInt(el.css('top'), 10),
						                    positionel.css('position'// to reset Opera on stop()
						                });
					            });
				        };
			        if (typeof(o.alsoResize) == 'object' && !o.alsoResize.parentNode) {
				            if (o.alsoResize.length) {
					o.alsoResize o.alsoResize[0];
					 _store(o.alsoResize);
					}
				            else { $.each(o.alsoResize, function (exp) {
						_store(exp);
						});
					}
				        }else{
				            _store(o.alsoResize);
				        }
			    },
		    resize: function (eventui) {
			        var self = $(this).data("resizable"), self.optionsos self.originalSizeop self.originalPosition;
			        var delta = {
				            height: (self.size.height os.height) || 0width: (self.size.width os.width) || 0,
				            top: (self.position.top op.top) || 0left: (self.position.left op.left) || 0
				        },
			        _alsoResize = function (expc) {
				            $(exp).each(function() {
					                var el = $(this), start = $(this).data("resizable-alsoresize"), style {}, 
					                    css && c.length el.parents(ui.originalElement[0]).length ? ['width''height'] : ['width''height''top''left'];
					                $.each(css, function (iprop) {
						                    var sum = (start[prop]||0) + (delta[prop]||0);
						                    if (sum && sum >= 0)
						                        style[prop] = sum || null;
						                });
					                // Opera fixing relative position
					                if ($.browser.opera && /relative/.test(el.css('position'))) {
						                    self._revertToRelativePosition true;
						                    el.css({ position'absolute'top'auto'left'auto'
							});
						                }
					                el.css(style);
					            });
				        };
			        if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
				            $.each(o.alsoResize, function (expc) {
					_alsoResize(expc);
					});
				        }else{
				            _alsoResize(o.alsoResize);
				        }
			    },
		    stop: function (eventui) {
			        var self = $(this).data("resizable"), self.options;
			        var _reset = function (exp) {
				            $(exp).each(function() {
					                var el = $(this);
					                // reset position for Opera - no need to verify it was changed
					                el.css({ positionel.data("resizable-alsoresize").position
						});
					            });
				        }
			        if (self._revertToRelativePosition) {
				            self._revertToRelativePosition false;
				            if (typeof(o.alsoResize) == 'object' && !o.alsoResize.nodeType) {
					                $.each(o.alsoResize, function (exp) {
						_reset(exp);
						});
					            }else{
					                _reset(o.alsoResize);
					            }
				        }
			        $(this).removeData("resizable-alsoresize");
			    }
		});
	$.ui.plugin.add("resizable""animate", {
		    stop: function(eventui) {
			        var self = $(this).data("resizable"), self.options;
			        var pr self._proportionallyResizeElementsista pr.length && (/textarea/i).test(pr[0].nodeName),
			                    soffseth ista && $.ui.hasScroll(pr[0], 'left'/* TODO - jump height */ self.sizeDiff.height,
			                        soffsetw ista self.sizeDiff.width;
			        var style = { width: (self.size.width soffsetw), height: (self.size.height soffseth)
				},
			                    left = (parseInt(self.element.css('left'), 10) + (self.position.left self.originalPosition.left)) || null,
			                        top = (parseInt(self.element.css('top'), 10) + (self.position.top self.originalPosition.top)) || null;
			        self.element.animate(
			            $.extend(styletop && left ? { toptopleftleft
				} : {}), {
				                durationo.animateDuration,
				                easingo.animateEasing,
				                step: function() {
					                    var data = {
						                        widthparseInt(self.element.css('width'), 10),
						                        heightparseInt(self.element.css('height'), 10),
						                        topparseInt(self.element.css('top'), 10),
						                        leftparseInt(self.element.css('left'), 10)
						                    };
					                    if (pr && pr.length) $(pr[0]).css({ widthdata.widthheightdata.height
						});
					                    // propagating resize, and updating values for each animation step
					                    self._updateCache(data);
					                    self._propagate("resize"event);
					                }
				            }
			        );
			    }
		});
	$.ui.plugin.add("resizable""containment", {
		    start: function(eventui) {
			        var self = $(this).data("resizable"), self.optionsel self.element;
			        var oc o.containment,    ce = (oc instanceof $) ? oc.get(0) : (/parent/.test(oc)) ? el.parent().get(0) : oc;
			        if (!ce) return;
			        self.containerElement = $(ce);
			        if (/document/.test(oc) || oc == document) {
				            self.containerOffset = { left0top0
					};
				            self.containerPosition = { left0top0
					};
				            self.parentData = {
					                element: $(document), left0top0,
					                width: $(document).width(), height: $(document).height() || document.body.parentNode.scrollHeight
					            };
				        }
			        // i'm a node, so compute top, left, right, bottom
			        else {
				            var element = $(ce), [];
				            $([ "Top""Right""Left""Bottom" ]).each(function(iname) {
					p[i] = num(element.css("padding" name));
					});
				            self.containerOffset element.offset();
				            self.containerPosition element.position();
				            self.containerSize = { height: (element.innerHeight() - p[3]), width: (element.innerWidth() - p[1])
					};
				            var co self.containerOffsetch self.containerSize.height,    cw self.containerSize.width,
				                        width = ($.ui.hasScroll(ce"left") ? ce.scrollWidth cw ), height = ($.ui.hasScroll(ce) ? ce.scrollHeight ch);
				            self.parentData = {
					                elementceleftco.lefttopco.topwidthwidthheightheight
					            };
				        }
			    },
		    resize: function(eventui) {
			        var self = $(this).data("resizable"), self.options,
			                ps self.containerSizeco self.containerOffsetcs self.sizecp self.position,
			                pRatio self._aspectRatio || event.shiftKeycop = { top:0left:0
				}, ce self.containerElement;
			        if (ce[0] != document && (/static/).test(ce.css('position'))) cop co;
			        if (cp.left < (self._helper co.left 0)) {
				            self.size.width self.size.width + (self._helper ? (self.position.left co.left) : (self.position.left cop.left));
				            if (pRatioself.size.height self.size.width o.aspectRatio;
				            self.position.left o.helper co.left 0;
				        }
			        if (cp.top < (self._helper co.top 0)) {
				            self.size.height self.size.height + (self._helper ? (self.position.top co.top) : self.position.top);
				            if (pRatioself.size.width self.size.height o.aspectRatio;
				            self.position.top self._helper co.top 0;
				        }
			        self.offset.left self.parentData.left+self.position.left;
			        self.offset.top self.parentData.top+self.position.top;
			        var woset Math.abs( (self._helper self.offset.left cop.left : (self.offset.left cop.left)) + self.sizeDiff.width ),
			                    hoset Math.abs( (self._helper self.offset.top cop.top : (self.offset.top co.top)) + self.sizeDiff.height );
			        var isParent self.containerElement.get(0) == self.element.parent().get(0),
			            isOffsetRelative = /relative|absolute/.test(self.containerElement.css('position'));
			        if(isParent && isOffsetRelativewoset -= self.parentData.left;
			        if (woset self.size.width >= self.parentData.width) {
				            self.size.width self.parentData.width woset;
				            if (pRatioself.size.height self.size.width self.aspectRatio;
				        }
			        if (hoset self.size.height >= self.parentData.height) {
				            self.size.height self.parentData.height hoset;
				            if (pRatioself.size.width self.size.height self.aspectRatio;
				        }
			    },
		    stop: function(eventui){
			        var self = $(this).data("resizable"), self.optionscp self.position,
			                co self.containerOffsetcop self.containerPositionce self.containerElement;
			        var helper = $(self.helper), ho helper.offset(), helper.outerWidth() - self.sizeDiff.widthhelper.outerHeight() - self.sizeDiff.height;
			        if (self._helper && !o.animate && (/relative/).test(ce.css('position')))
			            $(this).css({ leftho.left cop.left co.leftwidthwheighth
				});
			        if (self._helper && !o.animate && (/static/).test(ce.css('position')))
			            $(this).css({ leftho.left cop.left co.leftwidthwheighth
				});
			    }
		});
	$.ui.plugin.add("resizable""ghost", {
		    start: function(eventui) {
			        var self = $(this).data("resizable"), self.optionscs self.size;
			        self.ghost self.originalElement.clone();
			        self.ghost
			            .css({ opacity.25display'block'position'relative'heightcs.heightwidthcs.widthmargin0left0top0
				})
			            .addClass('ui-resizable-ghost')
			            .addClass(typeof o.ghost == 'string' o.ghost '');
			        self.ghost.appendTo(self.helper);
			    },
		    resize: function(eventui){
			        var self = $(this).data("resizable"), self.options;
			        if (self.ghostself.ghost.css({ position'relative'heightself.size.heightwidthself.size.width
				});
			    },
		    stop: function(eventui){
			        var self = $(this).data("resizable"), self.options;
			        if (self.ghost && self.helperself.helper.get(0).removeChild(self.ghost.get(0));
			    }
		});
	$.ui.plugin.add("resizable""grid", {
		    resize: function(eventui) {
			        var self = $(this).data("resizable"), self.optionscs self.sizeos self.originalSizeop self.originalPositionself.axisratio o._aspectRatio || event.shiftKey;
			        o.grid typeof o.grid == "number" ? [o.grido.grid] : o.grid;
			        var ox Math.round((cs.width os.width) / (o.grid[0]||1)) * (o.grid[0]||1), oy Math.round((cs.height os.height) / (o.grid[1]||1)) * (o.grid[1]||1);
			        if (/^(se|s|e)$/.test(a)) {
				            self.size.width os.width ox;
				            self.size.height os.height oy;
				        }
			        else if (/^(ne)$/.test(a)) {
				            self.size.width os.width ox;
				            self.size.height os.height oy;
				            self.position.top op.top oy;
				        }
			        else if (/^(sw)$/.test(a)) {
				            self.size.width os.width ox;
				            self.size.height os.height oy;
				            self.position.left op.left ox;
				        }
			        else {
				            self.size.width os.width ox;
				            self.size.height os.height oy;
				            self.position.top op.top oy;
				            self.position.left op.left ox;
				        }
			    }
		});
	var num = function(v) {
		    return parseInt(v10) || 0;
		};
	var isNumber = function(value) {
		    return !isNaN(parseInt(value10));
		};
	})(jQuery);





PHP Demo Source Code Index