/*! jquery ui - v1.11.4 - 2016-04-01 * http://jqueryui.com * includes: core.js, widget.js, mouse.js, position.js, draggable.js, droppable.js, resizable.js, selectable.js, sortable.js, accordion.js, autocomplete.js, button.js, datepicker.js, dialog.js, menu.js, progressbar.js, selectmenu.js, slider.js, spinner.js, tabs.js, effect.js, effect-blind.js, effect-bounce.js, effect-clip.js, effect-drop.js, effect-explode.js, effect-fade.js, effect-fold.js, effect-highlight.js, effect-puff.js, effect-pulsate.js, effect-scale.js, effect-shake.js, effect-size.js, effect-slide.js, effect-transfer.js * copyright jquery foundation and other contributors; licensed mit */ (function( factory ) { if ( typeof define === "function" && define.amd ) { // amd. register as an anonymous module. define([ "jquery" ], factory ); } else { // browser globals factory( jquery ); } }(function( $ ) { /*! * jquery ui core 1.11.4 * http://jqueryui.com * * copyright jquery foundation and other contributors * released under the mit license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */ // $.ui might exist from components with no dependencies, e.g., $.ui.position $.ui = $.ui || {}; $.extend( $.ui, { version: "1.11.4", keycode: { backspace: 8, comma: 188, delete: 46, down: 40, end: 35, enter: 13, escape: 27, home: 36, left: 37, page_down: 34, page_up: 33, period: 190, right: 39, space: 32, tab: 9, up: 38 } }); // plugins $.fn.extend({ scrollparent: function( includehidden ) { var position = this.css( "position" ), excludestaticparent = position === "absolute", overflowregex = includehidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, scrollparent = this.parents().filter( function() { var parent = $( this ); if ( excludestaticparent && parent.css( "position" ) === "static" ) { return false; } return overflowregex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); }).eq( 0 ); return position === "fixed" || !scrollparent.length ? $( this[ 0 ].ownerdocument || document ) : scrollparent; }, uniqueid: (function() { var uuid = 0; return function() { return this.each(function() { if ( !this.id ) { this.id = "ui-id-" + ( ++uuid ); } }); }; })(), removeuniqueid: function() { return this.each(function() { if ( /^ui-id-\d+$/.test( this.id ) ) { $( this ).removeattr( "id" ); } }); } }); // selectors function focusable( element, istabindexnotnan ) { var map, mapname, img, nodename = element.nodename.tolowercase(); if ( "area" === nodename ) { map = element.parentnode; mapname = map.name; if ( !element.href || !mapname || map.nodename.tolowercase() !== "map" ) { return false; } img = $( "img[usemap='#" + mapname + "']" )[ 0 ]; return !!img && visible( img ); } return ( /^(input|select|textarea|button|object)$/.test( nodename ) ? !element.disabled : "a" === nodename ? element.href || istabindexnotnan : istabindexnotnan) && // the element and all of its ancestors must be visible visible( element ); } function visible( element ) { return $.expr.filters.visible( element ) && !$( element ).parents().addback().filter(function() { return $.css( this, "visibility" ) === "hidden"; }).length; } $.extend( $.expr[ ":" ], { data: $.expr.createpseudo ? $.expr.createpseudo(function( dataname ) { return function( elem ) { return !!$.data( elem, dataname ); }; }) : // support: jquery <1.8 function( elem, i, match ) { return !!$.data( elem, match[ 3 ] ); }, focusable: function( element ) { return focusable( element, !isnan( $.attr( element, "tabindex" ) ) ); }, tabbable: function( element ) { var tabindex = $.attr( element, "tabindex" ), istabindexnan = isnan( tabindex ); return ( istabindexnan || tabindex >= 0 ) && focusable( element, !istabindexnan ); } }); // support: jquery <1.8 if ( !$( "" ).outerwidth( 1 ).jquery ) { $.each( [ "width", "height" ], function( i, name ) { var side = name === "width" ? [ "left", "right" ] : [ "top", "bottom" ], type = name.tolowercase(), orig = { innerwidth: $.fn.innerwidth, innerheight: $.fn.innerheight, outerwidth: $.fn.outerwidth, outerheight: $.fn.outerheight }; function reduce( elem, size, border, margin ) { $.each( side, function() { size -= parsefloat( $.css( elem, "padding" + this ) ) || 0; if ( border ) { size -= parsefloat( $.css( elem, "border" + this + "width" ) ) || 0; } if ( margin ) { size -= parsefloat( $.css( elem, "margin" + this ) ) || 0; } }); return size; } $.fn[ "inner" + name ] = function( size ) { if ( size === undefined ) { return orig[ "inner" + name ].call( this ); } return this.each(function() { $( this ).css( type, reduce( this, size ) + "px" ); }); }; $.fn[ "outer" + name] = function( size, margin ) { if ( typeof size !== "number" ) { return orig[ "outer" + name ].call( this, size ); } return this.each(function() { $( this).css( type, reduce( this, size, true, margin ) + "px" ); }); }; }); } // support: jquery <1.8 if ( !$.fn.addback ) { $.fn.addback = function( selector ) { return this.add( selector == null ? this.prevobject : this.prevobject.filter( selector ) ); }; } // support: jquery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) if ( $( "" ).data( "a-b", "a" ).removedata( "a-b" ).data( "a-b" ) ) { $.fn.removedata = (function( removedata ) { return function( key ) { if ( arguments.length ) { return removedata.call( this, $.camelcase( key ) ); } else { return removedata.call( this ); } }; })( $.fn.removedata ); } // deprecated $.ui.ie = !!/msie [\w.]+/.exec( navigator.useragent.tolowercase() ); $.fn.extend({ focus: (function( orig ) { return function( delay, fn ) { return typeof delay === "number" ? this.each(function() { var elem = this; settimeout(function() { $( elem ).focus(); if ( fn ) { fn.call( elem ); } }, delay ); }) : orig.apply( this, arguments ); }; })( $.fn.focus ), disableselection: (function() { var eventtype = "onselectstart" in document.createelement( "div" ) ? "selectstart" : "mousedown"; return function() { return this.bind( eventtype + ".ui-disableselection", function( event ) { event.preventdefault(); }); }; })(), enableselection: function() { return this.unbind( ".ui-disableselection" ); }, zindex: function( zindex ) { if ( zindex !== undefined ) { return this.css( "zindex", zindex ); } if ( this.length ) { var elem = $( this[ 0 ] ), position, value; while ( elem.length && elem[ 0 ] !== document ) { // ignore z-index if position is set to a value where z-index is ignored by the browser // this makes behavior of this function consistent across browsers // webkit always returns auto if the element is positioned position = elem.css( "position" ); if ( position === "absolute" || position === "relative" || position === "fixed" ) { // ie returns 0 when zindex is not specified // other browsers return a string // we ignore the case of nested elements with an explicit value of 0 //
value = parseint( elem.css( "zindex" ), 10 ); if ( !isnan( value ) && value !== 0 ) { return value; } } elem = elem.parent(); } } return 0; } }); // $.ui.plugin is deprecated. use $.widget() extensions instead. $.ui.plugin = { add: function( module, option, set ) { var i, proto = $.ui[ module ].prototype; for ( i in set ) { proto.plugins[ i ] = proto.plugins[ i ] || []; proto.plugins[ i ].push( [ option, set[ i ] ] ); } }, call: function( instance, name, args, allowdisconnected ) { var i, set = instance.plugins[ name ]; if ( !set ) { return; } if ( !allowdisconnected && ( !instance.element[ 0 ].parentnode || instance.element[ 0 ].parentnode.nodetype === 11 ) ) { return; } for ( i = 0; i < set.length; i++ ) { if ( instance.options[ set[ i ][ 0 ] ] ) { set[ i ][ 1 ].apply( instance.element, args ); } } } }; /*! * jquery ui widget 1.11.4 * http://jqueryui.com * * copyright jquery foundation and other contributors * released under the mit license. * http://jquery.org/license * * http://api.jqueryui.com/jquery.widget/ */ var widget_uuid = 0, widget_slice = array.prototype.slice; $.cleandata = (function( orig ) { return function( elems ) { var events, elem, i; for ( i = 0; (elem = elems[i]) != null; i++ ) { try { // only trigger remove when necessary to save time events = $._data( elem, "events" ); if ( events && events.remove ) { $( elem ).triggerhandler( "remove" ); } // http://bugs.jquery.com/ticket/8235 } catch ( e ) {} } orig( elems ); }; })( $.cleandata ); $.widget = function( name, base, prototype ) { var fullname, existingconstructor, constructor, baseprototype, // proxiedprototype allows the provided prototype to remain unmodified // so that it can be used as a mixin for multiple widgets (#8876) proxiedprototype = {}, namespace = name.split( "." )[ 0 ]; name = name.split( "." )[ 1 ]; fullname = namespace + "-" + name; if ( !prototype ) { prototype = base; base = $.widget; } // create selector for plugin $.expr[ ":" ][ fullname.tolowercase() ] = function( elem ) { return !!$.data( elem, fullname ); }; $[ namespace ] = $[ namespace ] || {}; existingconstructor = $[ namespace ][ name ]; constructor = $[ namespace ][ name ] = function( options, element ) { // allow instantiation without "new" keyword if ( !this._createwidget ) { return new constructor( options, element ); } // allow instantiation without initializing for simple inheritance // must use "new" keyword (the code above always passes args) if ( arguments.length ) { this._createwidget( options, element ); } }; // extend with the existing constructor to carry over any static properties $.extend( constructor, existingconstructor, { version: prototype.version, // copy the object used to create the prototype in case we need to // redefine the widget later _proto: $.extend( {}, prototype ), // track widgets that inherit from this widget in case this widget is // redefined after a widget inherits from it _childconstructors: [] }); baseprototype = new base(); // we need to make the options hash a property directly on the new instance // otherwise we'll modify the options hash on the prototype that we're // inheriting from baseprototype.options = $.widget.extend( {}, baseprototype.options ); $.each( prototype, function( prop, value ) { if ( !$.isfunction( value ) ) { proxiedprototype[ prop ] = value; return; } proxiedprototype[ prop ] = (function() { var _super = function() { return base.prototype[ prop ].apply( this, arguments ); }, _superapply = function( args ) { return base.prototype[ prop ].apply( this, args ); }; return function() { var __super = this._super, __superapply = this._superapply, returnvalue; this._super = _super; this._superapply = _superapply; returnvalue = value.apply( this, arguments ); this._super = __super; this._superapply = __superapply; return returnvalue; }; })(); }); constructor.prototype = $.widget.extend( baseprototype, { // todo: remove support for widgeteventprefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't dom-based widgeteventprefix: existingconstructor ? (baseprototype.widgeteventprefix || name) : name }, proxiedprototype, { constructor: constructor, namespace: namespace, widgetname: name, widgetfullname: fullname }); // if this widget is being redefined then we need to find all widgets that // are inheriting from it and redefine all of them so that they inherit from // the new version of this widget. we're essentially trying to replace one // level in the prototype chain. if ( existingconstructor ) { $.each( existingconstructor._childconstructors, function( i, child ) { var childprototype = child.prototype; // redefine the child widget using the same prototype that was // originally used, but inherit from the new version of the base $.widget( childprototype.namespace + "." + childprototype.widgetname, constructor, child._proto ); }); // remove the list of existing child constructors from the old constructor // so the old child constructors can be garbage collected delete existingconstructor._childconstructors; } else { base._childconstructors.push( constructor ); } $.widget.bridge( name, constructor ); return constructor; }; $.widget.extend = function( target ) { var input = widget_slice.call( arguments, 1 ), inputindex = 0, inputlength = input.length, key, value; for ( ; inputindex < inputlength; inputindex++ ) { for ( key in input[ inputindex ] ) { value = input[ inputindex ][ key ]; if ( input[ inputindex ].hasownproperty( key ) && value !== undefined ) { // clone objects if ( $.isplainobject( value ) ) { target[ key ] = $.isplainobject( target[ key ] ) ? $.widget.extend( {}, target[ key ], value ) : // don't extend strings, arrays, etc. with objects $.widget.extend( {}, value ); // copy everything else by reference } else { target[ key ] = value; } } } } return target; }; $.widget.bridge = function( name, object ) { var fullname = object.prototype.widgetfullname || name; $.fn[ name ] = function( options ) { var ismethodcall = typeof options === "string", args = widget_slice.call( arguments, 1 ), returnvalue = this; if ( ismethodcall ) { this.each(function() { var methodvalue, instance = $.data( this, fullname ); if ( options === "instance" ) { returnvalue = instance; return false; } if ( !instance ) { return $.error( "cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'" ); } if ( !$.isfunction( instance[options] ) || options.charat( 0 ) === "_" ) { return $.error( "no such method '" + options + "' for " + name + " widget instance" ); } methodvalue = instance[ options ].apply( instance, args ); if ( methodvalue !== instance && methodvalue !== undefined ) { returnvalue = methodvalue && methodvalue.jquery ? returnvalue.pushstack( methodvalue.get() ) : methodvalue; return false; } }); } else { // allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat(args) ); } this.each(function() { var instance = $.data( this, fullname ); if ( instance ) { instance.option( options || {} ); if ( instance._init ) { instance._init(); } } else { $.data( this, fullname, new object( options, this ) ); } }); } return returnvalue; }; }; $.widget = function( /* options, element */ ) {}; $.widget._childconstructors = []; $.widget.prototype = { widgetname: "widget", widgeteventprefix: "", defaultelement: "
", options: { disabled: false, // callbacks create: null }, _createwidget: function( options, element ) { element = $( element || this.defaultelement || this )[ 0 ]; this.element = $( element ); this.uuid = widget_uuid++; this.eventnamespace = "." + this.widgetname + this.uuid; this.bindings = $(); this.hoverable = $(); this.focusable = $(); if ( element !== this ) { $.data( element, this.widgetfullname, this ); this._on( true, this.element, { remove: function( event ) { if ( event.target === element ) { this.destroy(); } } }); this.document = $( element.style ? // element within the document element.ownerdocument : // element is window or document element.document || element ); this.window = $( this.document[0].defaultview || this.document[0].parentwindow ); } this.options = $.widget.extend( {}, this.options, this._getcreateoptions(), options ); this._create(); this._trigger( "create", null, this._getcreateeventdata() ); this._init(); }, _getcreateoptions: $.noop, _getcreateeventdata: $.noop, _create: $.noop, _init: $.noop, destroy: function() { this._destroy(); // we can probably remove the unbind calls in 2.0 // all event bindings should go through this._on() this.element .unbind( this.eventnamespace ) .removedata( this.widgetfullname ) // support: jquery <1.6.3 // http://bugs.jquery.com/ticket/9413 .removedata( $.camelcase( this.widgetfullname ) ); this.widget() .unbind( this.eventnamespace ) .removeattr( "aria-disabled" ) .removeclass( this.widgetfullname + "-disabled " + "ui-state-disabled" ); // clean up events and states this.bindings.unbind( this.eventnamespace ); this.hoverable.removeclass( "ui-state-hover" ); this.focusable.removeclass( "ui-state-focus" ); }, _destroy: $.noop, widget: function() { return this.element; }, option: function( key, value ) { var options = key, parts, curoption, i; if ( arguments.length === 0 ) { // don't return a reference to the internal hash return $.widget.extend( {}, this.options ); } if ( typeof key === "string" ) { // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } options = {}; parts = key.split( "." ); key = parts.shift(); if ( parts.length ) { curoption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); for ( i = 0; i < parts.length - 1; i++ ) { curoption[ parts[ i ] ] = curoption[ parts[ i ] ] || {}; curoption = curoption[ parts[ i ] ]; } key = parts.pop(); if ( arguments.length === 1 ) { return curoption[ key ] === undefined ? null : curoption[ key ]; } curoption[ key ] = value; } else { if ( arguments.length === 1 ) { return this.options[ key ] === undefined ? null : this.options[ key ]; } options[ key ] = value; } } this._setoptions( options ); return this; }, _setoptions: function( options ) { var key; for ( key in options ) { this._setoption( key, options[ key ] ); } return this; }, _setoption: function( key, value ) { this.options[ key ] = value; if ( key === "disabled" ) { this.widget() .toggleclass( this.widgetfullname + "-disabled", !!value ); // if the widget is becoming disabled, then nothing is interactive if ( value ) { this.hoverable.removeclass( "ui-state-hover" ); this.focusable.removeclass( "ui-state-focus" ); } } return this; }, enable: function() { return this._setoptions({ disabled: false }); }, disable: function() { return this._setoptions({ disabled: true }); }, _on: function( suppressdisabledcheck, element, handlers ) { var delegateelement, instance = this; // no suppressdisabledcheck flag, shuffle arguments if ( typeof suppressdisabledcheck !== "boolean" ) { handlers = element; element = suppressdisabledcheck; suppressdisabledcheck = false; } // no element argument, shuffle and use this.element if ( !handlers ) { handlers = element; element = this.element; delegateelement = this.widget(); } else { element = delegateelement = $( element ); this.bindings = this.bindings.add( element ); } $.each( handlers, function( event, handler ) { function handlerproxy() { // allow widgets to customize the disabled handling // - disabled as an array instead of boolean // - disabled class as method for disabling individual parts if ( !suppressdisabledcheck && ( instance.options.disabled === true || $( this ).hasclass( "ui-state-disabled" ) ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } // copy the guid so direct unbinding works if ( typeof handler !== "string" ) { handlerproxy.guid = handler.guid = handler.guid || handlerproxy.guid || $.guid++; } var match = event.match( /^([\w:-]*)\s*(.*)$/ ), eventname = match[1] + instance.eventnamespace, selector = match[2]; if ( selector ) { delegateelement.delegate( selector, eventname, handlerproxy ); } else { element.bind( eventname, handlerproxy ); } }); }, _off: function( element, eventname ) { eventname = (eventname || "").split( " " ).join( this.eventnamespace + " " ) + this.eventnamespace; element.unbind( eventname ).undelegate( eventname ); // clear the stack to avoid memory leaks (#10056) this.bindings = $( this.bindings.not( element ).get() ); this.focusable = $( this.focusable.not( element ).get() ); this.hoverable = $( this.hoverable.not( element ).get() ); }, _delay: function( handler, delay ) { function handlerproxy() { return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } var instance = this; return settimeout( handlerproxy, delay || 0 ); }, _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._on( element, { mouseenter: function( event ) { $( event.currenttarget ).addclass( "ui-state-hover" ); }, mouseleave: function( event ) { $( event.currenttarget ).removeclass( "ui-state-hover" ); } }); }, _focusable: function( element ) { this.focusable = this.focusable.add( element ); this._on( element, { focusin: function( event ) { $( event.currenttarget ).addclass( "ui-state-focus" ); }, focusout: function( event ) { $( event.currenttarget ).removeclass( "ui-state-focus" ); } }); }, _trigger: function( type, event, data ) { var prop, orig, callback = this.options[ type ]; data = data || {}; event = $.event( event ); event.type = ( type === this.widgeteventprefix ? type : this.widgeteventprefix + type ).tolowercase(); // the original event may come from any element // so we need to reset the target on the new event event.target = this.element[ 0 ]; // copy original event properties over to the new event orig = event.originalevent; if ( orig ) { for ( prop in orig ) { if ( !( prop in event ) ) { event[ prop ] = orig[ prop ]; } } } this.element.trigger( event, data ); return !( $.isfunction( callback ) && callback.apply( this.element[0], [ event ].concat( data ) ) === false || event.isdefaultprevented() ); } }; $.each( { show: "fadein", hide: "fadeout" }, function( method, defaulteffect ) { $.widget.prototype[ "_" + method ] = function( element, options, callback ) { if ( typeof options === "string" ) { options = { effect: options }; } var hasoptions, effectname = !options ? method : options === true || typeof options === "number" ? defaulteffect : options.effect || defaulteffect; options = options || {}; if ( typeof options === "number" ) { options = { duration: options }; } hasoptions = !$.isemptyobject( options ); options.complete = callback; if ( options.delay ) { element.delay( options.delay ); } if ( hasoptions && $.effects && $.effects.effect[ effectname ] ) { element[ method ]( options ); } else if ( effectname !== method && element[ effectname ] ) { element[ effectname ]( options.duration, options.easing, callback ); } else { element.queue(function( next ) { $( this )[ method ](); if ( callback ) { callback.call( element[ 0 ] ); } next(); }); } }; }); var widget = $.widget; /*! * jquery ui mouse 1.11.4 * http://jqueryui.com * * copyright jquery foundation and other contributors * released under the mit license. * http://jquery.org/license * * http://api.jqueryui.com/mouse/ */ var mousehandled = false; $( document ).mouseup( function() { mousehandled = false; }); var mouse = $.widget("ui.mouse", { version: "1.11.4", options: { cancel: "input,textarea,button,select,option", distance: 1, delay: 0 }, _mouseinit: function() { var that = this; this.element .bind("mousedown." + this.widgetname, function(event) { return that._mousedown(event); }) .bind("click." + this.widgetname, function(event) { if (true === $.data(event.target, that.widgetname + ".preventclickevent")) { $.removedata(event.target, that.widgetname + ".preventclickevent"); event.stopimmediatepropagation(); return false; } }); this.started = false; }, // todo: make sure destroying one instance of mouse doesn't mess with // other instances of mouse _mousedestroy: function() { this.element.unbind("." + this.widgetname); if ( this._mousemovedelegate ) { this.document .unbind("mousemove." + this.widgetname, this._mousemovedelegate) .unbind("mouseup." + this.widgetname, this._mouseupdelegate); } }, _mousedown: function(event) { // don't let more than one widget handle mousestart if ( mousehandled ) { return; } this._mousemoved = false; // we may have missed mouseup (out of window) (this._mousestarted && this._mouseup(event)); this._mousedownevent = event; var that = this, btnisleft = (event.which === 1), // event.target.nodename works around a bug in ie 8 with // disabled inputs (#7620) eliscancel = (typeof this.options.cancel === "string" && event.target.nodename ? $(event.target).closest(this.options.cancel).length : false); if (!btnisleft || eliscancel || !this._mousecapture(event)) { return true; } this.mousedelaymet = !this.options.delay; if (!this.mousedelaymet) { this._mousedelaytimer = settimeout(function() { that.mousedelaymet = true; }, this.options.delay); } if (this._mousedistancemet(event) && this._mousedelaymet(event)) { this._mousestarted = (this._mousestart(event) !== false); if (!this._mousestarted) { event.preventdefault(); return true; } } // click event may never have fired (gecko & opera) if (true === $.data(event.target, this.widgetname + ".preventclickevent")) { $.removedata(event.target, this.widgetname + ".preventclickevent"); } // these delegates are required to keep context this._mousemovedelegate = function(event) { return that._mousemove(event); }; this._mouseupdelegate = function(event) { return that._mouseup(event); }; this.document .bind( "mousemove." + this.widgetname, this._mousemovedelegate ) .bind( "mouseup." + this.widgetname, this._mouseupdelegate ); event.preventdefault(); mousehandled = true; return true; }, _mousemove: function(event) { // only check for mouseups outside the document if you've moved inside the document // at least once. this prevents the firing of mouseup in the case of ie<9, which will // fire a mousemove event if content is placed under the cursor. see #7778 // support: ie <9 if ( this._mousemoved ) { // ie mouseup check - mouseup happened when mouse was out of window if ($.ui.ie && ( !document.documentmode || document.documentmode < 9 ) && !event.button) { return this._mouseup(event); // iframe mouseup check - mouseup occurred in another document } else if ( !event.which ) { return this._mouseup( event ); } } if ( event.which || event.button ) { this._mousemoved = true; } if (this._mousestarted) { this._mousedrag(event); return event.preventdefault(); } if (this._mousedistancemet(event) && this._mousedelaymet(event)) { this._mousestarted = (this._mousestart(this._mousedownevent, event) !== false); (this._mousestarted ? this._mousedrag(event) : this._mouseup(event)); } return !this._mousestarted; }, _mouseup: function(event) { this.document .unbind( "mousemove." + this.widgetname, this._mousemovedelegate ) .unbind( "mouseup." + this.widgetname, this._mouseupdelegate ); if (this._mousestarted) { this._mousestarted = false; if (event.target === this._mousedownevent.target) { $.data(event.target, this.widgetname + ".preventclickevent", true); } this._mousestop(event); } mousehandled = false; return false; }, _mousedistancemet: function(event) { return (math.max( math.abs(this._mousedownevent.pagex - event.pagex), math.abs(this._mousedownevent.pagey - event.pagey) ) >= this.options.distance ); }, _mousedelaymet: function(/* event */) { return this.mousedelaymet; }, // these are placeholder methods, to be overriden by extending plugin _mousestart: function(/* event */) {}, _mousedrag: function(/* event */) {}, _mousestop: function(/* event */) {}, _mousecapture: function(/* event */) { return true; } }); /*! * jquery ui position 1.11.4 * http://jqueryui.com * * copyright jquery foundation and other contributors * released under the mit license. * http://jquery.org/license * * http://api.jqueryui.com/position/ */ (function() { $.ui = $.ui || {}; var cachedscrollbarwidth, supportsoffsetfractions, max = math.max, abs = math.abs, round = math.round, rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, roffset = /[\+\-]\d+(\.[\d]+)?%?/, rposition = /^\w+/, rpercent = /%$/, _position = $.fn.position; function getoffsets( offsets, width, height ) { return [ parsefloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), parsefloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) ]; } function parsecss( element, property ) { return parseint( $.css( element, property ), 10 ) || 0; } function getdimensions( elem ) { var raw = elem[0]; if ( raw.nodetype === 9 ) { return { width: elem.width(), height: elem.height(), offset: { top: 0, left: 0 } }; } if ( $.iswindow( raw ) ) { return { width: elem.width(), height: elem.height(), offset: { top: elem.scrolltop(), left: elem.scrollleft() } }; } if ( raw.preventdefault ) { return { width: 0, height: 0, offset: { top: raw.pagey, left: raw.pagex } }; } return { width: elem.outerwidth(), height: elem.outerheight(), offset: elem.offset() }; } $.position = { scrollbarwidth: function() { if ( cachedscrollbarwidth !== undefined ) { return cachedscrollbarwidth; } var w1, w2, div = $( "
" ), innerdiv = div.children()[0]; $( "body" ).append( div ); w1 = innerdiv.offsetwidth; div.css( "overflow", "scroll" ); w2 = innerdiv.offsetwidth; if ( w1 === w2 ) { w2 = div[0].clientwidth; } div.remove(); return (cachedscrollbarwidth = w1 - w2); }, getscrollinfo: function( within ) { var overflowx = within.iswindow || within.isdocument ? "" : within.element.css( "overflow-x" ), overflowy = within.iswindow || within.isdocument ? "" : within.element.css( "overflow-y" ), hasoverflowx = overflowx === "scroll" || ( overflowx === "auto" && within.width < within.element[0].scrollwidth ), hasoverflowy = overflowy === "scroll" || ( overflowy === "auto" && within.height < within.element[0].scrollheight ); return { width: hasoverflowy ? $.position.scrollbarwidth() : 0, height: hasoverflowx ? $.position.scrollbarwidth() : 0 }; }, getwithininfo: function( element ) { var withinelement = $( element || window ), iswindow = $.iswindow( withinelement[0] ), isdocument = !!withinelement[ 0 ] && withinelement[ 0 ].nodetype === 9; return { element: withinelement, iswindow: iswindow, isdocument: isdocument, offset: withinelement.offset() || { left: 0, top: 0 }, scrollleft: withinelement.scrollleft(), scrolltop: withinelement.scrolltop(), // support: jquery 1.6.x // jquery 1.6 doesn't support .outerwidth/height() on documents or windows width: iswindow || isdocument ? withinelement.width() : withinelement.outerwidth(), height: iswindow || isdocument ? withinelement.height() : withinelement.outerheight() }; } }; $.fn.position = function( options ) { if ( !options || !options.of ) { return _position.apply( this, arguments ); } // make a copy, we don't want to modify arguments options = $.extend( {}, options ); var atoffset, targetwidth, targetheight, targetoffset, baseposition, dimensions, target = $( options.of ), within = $.position.getwithininfo( options.within ), scrollinfo = $.position.getscrollinfo( within ), collision = ( options.collision || "flip" ).split( " " ), offsets = {}; dimensions = getdimensions( target ); if ( target[0].preventdefault ) { // force left top to allow flipping options.at = "left top"; } targetwidth = dimensions.width; targetheight = dimensions.height; targetoffset = dimensions.offset; // clone to reuse original targetoffset later baseposition = $.extend( {}, targetoffset ); // force my and at to have valid horizontal and vertical positions // if a value is missing or invalid, it will be converted to center $.each( [ "my", "at" ], function() { var pos = ( options[ this ] || "" ).split( " " ), horizontaloffset, verticaloffset; if ( pos.length === 1) { pos = rhorizontal.test( pos[ 0 ] ) ? pos.concat( [ "center" ] ) : rvertical.test( pos[ 0 ] ) ? [ "center" ].concat( pos ) : [ "center", "center" ]; } pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; // calculate offsets horizontaloffset = roffset.exec( pos[ 0 ] ); verticaloffset = roffset.exec( pos[ 1 ] ); offsets[ this ] = [ horizontaloffset ? horizontaloffset[ 0 ] : 0, verticaloffset ? verticaloffset[ 0 ] : 0 ]; // reduce to just the positions without the offsets options[ this ] = [ rposition.exec( pos[ 0 ] )[ 0 ], rposition.exec( pos[ 1 ] )[ 0 ] ]; }); // normalize collision option if ( collision.length === 1 ) { collision[ 1 ] = collision[ 0 ]; } if ( options.at[ 0 ] === "right" ) { baseposition.left += targetwidth; } else if ( options.at[ 0 ] === "center" ) { baseposition.left += targetwidth / 2; } if ( options.at[ 1 ] === "bottom" ) { baseposition.top += targetheight; } else if ( options.at[ 1 ] === "center" ) { baseposition.top += targetheight / 2; } atoffset = getoffsets( offsets.at, targetwidth, targetheight ); baseposition.left += atoffset[ 0 ]; baseposition.top += atoffset[ 1 ]; return this.each(function() { var collisionposition, using, elem = $( this ), elemwidth = elem.outerwidth(), elemheight = elem.outerheight(), marginleft = parsecss( this, "marginleft" ), margintop = parsecss( this, "margintop" ), collisionwidth = elemwidth + marginleft + parsecss( this, "marginright" ) + scrollinfo.width, collisionheight = elemheight + margintop + parsecss( this, "marginbottom" ) + scrollinfo.height, position = $.extend( {}, baseposition ), myoffset = getoffsets( offsets.my, elem.outerwidth(), elem.outerheight() ); if ( options.my[ 0 ] === "right" ) { position.left -= elemwidth; } else if ( options.my[ 0 ] === "center" ) { position.left -= elemwidth / 2; } if ( options.my[ 1 ] === "bottom" ) { position.top -= elemheight; } else if ( options.my[ 1 ] === "center" ) { position.top -= elemheight / 2; } position.left += myoffset[ 0 ]; position.top += myoffset[ 1 ]; // if the browser doesn't support fractions, then round for consistent results if ( !supportsoffsetfractions ) { position.left = round( position.left ); position.top = round( position.top ); } collisionposition = { marginleft: marginleft, margintop: margintop }; $.each( [ "left", "top" ], function( i, dir ) { if ( $.ui.position[ collision[ i ] ] ) { $.ui.position[ collision[ i ] ][ dir ]( position, { targetwidth: targetwidth, targetheight: targetheight, elemwidth: elemwidth, elemheight: elemheight, collisionposition: collisionposition, collisionwidth: collisionwidth, collisionheight: collisionheight, offset: [ atoffset[ 0 ] + myoffset[ 0 ], atoffset [ 1 ] + myoffset[ 1 ] ], my: options.my, at: options.at, within: within, elem: elem }); } }); if ( options.using ) { // adds feedback as second argument to using callback, if present using = function( props ) { var left = targetoffset.left - position.left, right = left + targetwidth - elemwidth, top = targetoffset.top - position.top, bottom = top + targetheight - elemheight, feedback = { target: { element: target, left: targetoffset.left, top: targetoffset.top, width: targetwidth, height: targetheight }, element: { element: elem, left: position.left, top: position.top, width: elemwidth, height: elemheight }, horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" }; if ( targetwidth < elemwidth && abs( left + right ) < targetwidth ) { feedback.horizontal = "center"; } if ( targetheight < elemheight && abs( top + bottom ) < targetheight ) { feedback.vertical = "middle"; } if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { feedback.important = "horizontal"; } else { feedback.important = "vertical"; } options.using.call( this, props, feedback ); }; } elem.offset( $.extend( position, { using: using } ) ); }); }; $.ui.position = { fit: { left: function( position, data ) { var within = data.within, withinoffset = within.iswindow ? within.scrollleft : within.offset.left, outerwidth = within.width, collisionposleft = position.left - data.collisionposition.marginleft, overleft = withinoffset - collisionposleft, overright = collisionposleft + data.collisionwidth - outerwidth - withinoffset, newoverright; // element is wider than within if ( data.collisionwidth > outerwidth ) { // element is initially over the left side of within if ( overleft > 0 && overright <= 0 ) { newoverright = position.left + overleft + data.collisionwidth - outerwidth - withinoffset; position.left += overleft - newoverright; // element is initially over right side of within } else if ( overright > 0 && overleft <= 0 ) { position.left = withinoffset; // element is initially over both left and right sides of within } else { if ( overleft > overright ) { position.left = withinoffset + outerwidth - data.collisionwidth; } else { position.left = withinoffset; } } // too far left -> align with left edge } else if ( overleft > 0 ) { position.left += overleft; // too far right -> align with right edge } else if ( overright > 0 ) { position.left -= overright; // adjust based on position and margin } else { position.left = max( position.left - collisionposleft, position.left ); } }, top: function( position, data ) { var within = data.within, withinoffset = within.iswindow ? within.scrolltop : within.offset.top, outerheight = data.within.height, collisionpostop = position.top - data.collisionposition.margintop, overtop = withinoffset - collisionpostop, overbottom = collisionpostop + data.collisionheight - outerheight - withinoffset, newoverbottom; // element is taller than within if ( data.collisionheight > outerheight ) { // element is initially over the top of within if ( overtop > 0 && overbottom <= 0 ) { newoverbottom = position.top + overtop + data.collisionheight - outerheight - withinoffset; position.top += overtop - newoverbottom; // element is initially over bottom of within } else if ( overbottom > 0 && overtop <= 0 ) { position.top = withinoffset; // element is initially over both top and bottom of within } else { if ( overtop > overbottom ) { position.top = withinoffset + outerheight - data.collisionheight; } else { position.top = withinoffset; } } // too far up -> align with top } else if ( overtop > 0 ) { position.top += overtop; // too far down -> align with bottom edge } else if ( overbottom > 0 ) { position.top -= overbottom; // adjust based on position and margin } else { position.top = max( position.top - collisionpostop, position.top ); } } }, flip: { left: function( position, data ) { var within = data.within, withinoffset = within.offset.left + within.scrollleft, outerwidth = within.width, offsetleft = within.iswindow ? within.scrollleft : within.offset.left, collisionposleft = position.left - data.collisionposition.marginleft, overleft = collisionposleft - offsetleft, overright = collisionposleft + data.collisionwidth - outerwidth - offsetleft, myoffset = data.my[ 0 ] === "left" ? -data.elemwidth : data.my[ 0 ] === "right" ? data.elemwidth : 0, atoffset = data.at[ 0 ] === "left" ? data.targetwidth : data.at[ 0 ] === "right" ? -data.targetwidth : 0, offset = -2 * data.offset[ 0 ], newoverright, newoverleft; if ( overleft < 0 ) { newoverright = position.left + myoffset + atoffset + offset + data.collisionwidth - outerwidth - withinoffset; if ( newoverright < 0 || newoverright < abs( overleft ) ) { position.left += myoffset + atoffset + offset; } } else if ( overright > 0 ) { newoverleft = position.left - data.collisionposition.marginleft + myoffset + atoffset + offset - offsetleft; if ( newoverleft > 0 || abs( newoverleft ) < overright ) { position.left += myoffset + atoffset + offset; } } }, top: function( position, data ) { var within = data.within, withinoffset = within.offset.top + within.scrolltop, outerheight = within.height, offsettop = within.iswindow ? within.scrolltop : within.offset.top, collisionpostop = position.top - data.collisionposition.margintop, overtop = collisionpostop - offsettop, overbottom = collisionpostop + data.collisionheight - outerheight - offsettop, top = data.my[ 1 ] === "top", myoffset = top ? -data.elemheight : data.my[ 1 ] === "bottom" ? data.elemheight : 0, atoffset = data.at[ 1 ] === "top" ? data.targetheight : data.at[ 1 ] === "bottom" ? -data.targetheight : 0, offset = -2 * data.offset[ 1 ], newovertop, newoverbottom; if ( overtop < 0 ) { newoverbottom = position.top + myoffset + atoffset + offset + data.collisionheight - outerheight - withinoffset; if ( newoverbottom < 0 || newoverbottom < abs( overtop ) ) { position.top += myoffset + atoffset + offset; } } else if ( overbottom > 0 ) { newovertop = position.top - data.collisionposition.margintop + myoffset + atoffset + offset - offsettop; if ( newovertop > 0 || abs( newovertop ) < overbottom ) { position.top += myoffset + atoffset + offset; } } } }, flipfit: { left: function() { $.ui.position.flip.left.apply( this, arguments ); $.ui.position.fit.left.apply( this, arguments ); }, top: function() { $.ui.position.flip.top.apply( this, arguments ); $.ui.position.fit.top.apply( this, arguments ); } } }; // fraction support test (function() { var testelement, testelementparent, testelementstyle, offsetleft, i, body = document.getelementsbytagname( "body" )[ 0 ], div = document.createelement( "div" ); //create a "fake body" for testing based on method used in jquery.support testelement = document.createelement( body ? "div" : "body" ); testelementstyle = { visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }; if ( body ) { $.extend( testelementstyle, { position: "absolute", left: "-1000px", top: "-1000px" }); } for ( i in testelementstyle ) { testelement.style[ i ] = testelementstyle[ i ]; } testelement.appendchild( div ); testelementparent = body || document.documentelement; testelementparent.insertbefore( testelement, testelementparent.firstchild ); div.style.csstext = "position: absolute; left: 10.7432222px;"; offsetleft = $( div ).offset().left; supportsoffsetfractions = offsetleft > 10 && offsetleft < 11; testelement.innerhtml = ""; testelementparent.removechild( testelement ); })(); })(); var position = $.ui.position; /*! * jquery ui draggable 1.11.4 * http://jqueryui.com * * copyright jquery foundation and other contributors * released under the mit license. * http://jquery.org/license * * http://api.jqueryui.com/draggable/ */ $.widget("ui.draggable", $.ui.mouse, { version: "1.11.4", widgeteventprefix: "drag", options: { addclasses: true, appendto: "parent", axis: false, connecttosortable: false, containment: false, cursor: "auto", cursorat: false, grid: false, handle: false, helper: "original", iframefix: false, opacity: false, refreshpositions: false, revert: false, revertduration: 500, scope: "default", scroll: true, scrollsensitivity: 20, scrollspeed: 20, snap: false, snapmode: "both", snaptolerance: 20, stack: false, zindex: false, // callbacks drag: null, start: null, stop: null }, _create: function() { if ( this.options.helper === "original" ) { this._setpositionrelative(); } if (this.options.addclasses){ this.element.addclass("ui-draggable"); } if (this.options.disabled){ this.element.addclass("ui-draggable-disabled"); } this._sethandleclassname(); this._mouseinit(); }, _setoption: function( key, value ) { this._super( key, value ); if ( key === "handle" ) { this._removehandleclassname(); this._sethandleclassname(); } }, _destroy: function() { if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { this.destroyonclear = true; return; } this.element.removeclass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); this._removehandleclassname(); this._mousedestroy(); }, _mousecapture: function(event) { var o = this.options; this._bluractiveelement( event ); // among others, prevent a drag on a resizable-handle if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) { return false; } //quit if we're not on a valid handle this.handle = this._gethandle(event); if (!this.handle) { return false; } this._blockframes( o.iframefix === true ? "iframe" : o.iframefix ); return true; }, _blockframes: function( selector ) { this.iframeblocks = this.document.find( selector ).map(function() { var iframe = $( this ); return $( "
" ) .css( "position", "absolute" ) .appendto( iframe.parent() ) .outerwidth( iframe.outerwidth() ) .outerheight( iframe.outerheight() ) .offset( iframe.offset() )[ 0 ]; }); }, _unblockframes: function() { if ( this.iframeblocks ) { this.iframeblocks.remove(); delete this.iframeblocks; } }, _bluractiveelement: function( event ) { var document = this.document[ 0 ]; // only need to blur if the event occurred on the draggable itself, see #10527 if ( !this.handleelement.is( event.target ) ) { return; } // support: ie9 // ie9 throws an "unspecified error" accessing document.activeelement from an