",options:{disabled:!1,create:null},_createWidget:function(t,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=s++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var s,n,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},s=t.split("."),t=s.shift(),s.length){for(n=o[t]=e.widget.extend({},this.options[t]),a=0;s.length-1>a;a++)n[s[a]]=n[s[a]]||{},n=n[s[a]];if(t=s.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=i}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,i,s){var n,a=this;"boolean"!=typeof t&&(s=i,i=t,t=!1),s?(i=n=e(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),e.each(s,function(s,o){function r(){return t||a.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?a[o]:o).apply(a,arguments):void 0}"string"!=typeof o&&(r.guid=o.guid=o.guid||r.guid||e.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+a.eventNamespace,u=h[2];u?n.delegate(u,l,r):i.bind(l,r)})},_off:function(t,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(i).undelegate(i),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,o=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(o)&&o.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var o,r=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),o=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),o&&e.effects&&e.effects.effect[r]?s[t](n):r!==t&&s[r]?s[r](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}}),e.widget;var a=!1;e(document).mouseup(function(){a=!1}),e.widget("ui.mouse",{version:"1.11.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!a){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var i=this,s=1===t.which,n="string"==typeof this.options.cancel&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(t)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(t)!==!1,!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return i._mouseMove(e)},this._mouseUpDelegate=function(e){return i._mouseUp(e)},this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),a=!0,!0)):!0}},_mouseMove:function(t){if(this._mouseMoved){if(e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),a=!1,!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),e.widget("ui.draggable",e.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(e,t){this._super(e,t),"handle"===e&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(t){var i=this.options;return this._blurActiveElement(t),this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(t),this.handle?(this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=e(this);return e("
").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var i=this.document[0];if(this.handleElement.is(t.target))try{i.activeElement&&"body"!==i.activeElement.nodeName.toLowerCase()&&e(i.activeElement).blur()}catch(s){}},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===e(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._normalizeRightBottom(),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(e){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:e.pageX-this.offset.left,top:e.pageY-this.offset.top}},_mouseDrag:function(t,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.focus(),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this.handleElement.addClass("ui-draggable-handle")},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle")},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper),n=s?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(e){return/(html|body)/i.test(e.tagName)||e===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var e=this.element.position(),t=this._isRootNode(this.scrollParent[0]);return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+(t?0:this.scrollParent.scrollTop()),left:e.left-(parseInt(this.helper.css("left"),10)||0)+(t?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options,a=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,e(a).width()-this.helperProportions.width-this.margins.left,(e(a).height()||a.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0)},_convertPositionTo:function(e,t){t||(t=this.position);var i="absolute"===e?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:t.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:t.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(e,t){var i,s,n,a,o=this.options,r=this._isRootNode(this.scrollParent[0]),h=e.pageX,l=e.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),t&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.left
i[2]&&(h=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a),"y"===o.axis&&(h=this.originalPageX),"x"===o.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i,s){var n=e.extend({},i,{item:s.element});s.sortables=[],e(s.options.connectToSortable).each(function(){var i=e(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",t,n))})},stop:function(t,i,s){var n=e.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,e.each(s.sortables,function(){var e=this;e.isOver?(e.isOver=0,s.cancelHelperRemoval=!0,e.cancelHelperRemoval=!1,e._storedCSS={position:e.placeholder.css("position"),top:e.placeholder.css("top"),left:e.placeholder.css("left")},e._mouseStop(t),e.options.helper=e.options._helper):(e.cancelHelperRemoval=!0,e._trigger("deactivate",t,n))})},drag:function(t,i,s){e.each(s.sortables,function(){var n=!1,a=this;a.positionAbs=s.positionAbs,a.helperProportions=s.helperProportions,a.offset.click=s.offset.click,a._intersectsWith(a.containerCache)&&(n=!0,e.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==a&&this._intersectsWith(this.containerCache)&&e.contains(a.element[0],this.element[0])&&(n=!1),n})),n?(a.isOver||(a.isOver=1,s._parent=i.helper.parent(),a.currentItem=i.helper.appendTo(a.element).data("ui-sortable-item",!0),a.options._helper=a.options.helper,a.options.helper=function(){return i.helper[0]},t.target=a.currentItem[0],a._mouseCapture(t,!0),a._mouseStart(t,!0,!0),a.offset.click.top=s.offset.click.top,a.offset.click.left=s.offset.click.left,a.offset.parent.left-=s.offset.parent.left-a.offset.parent.left,a.offset.parent.top-=s.offset.parent.top-a.offset.parent.top,s._trigger("toSortable",t),s.dropped=a.element,e.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,a.fromOutside=s),a.currentItem&&(a._mouseDrag(t),i.position=a.position)):a.isOver&&(a.isOver=0,a.cancelHelperRemoval=!0,a.options._revert=a.options.revert,a.options.revert=!1,a._trigger("out",t,a._uiHash(a)),a._mouseStop(t,!0),a.options.revert=a.options._revert,a.options.helper=a.options._helper,a.placeholder&&a.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(t),i.position=s._generatePosition(t,!0),s._trigger("fromSortable",t),s.dropped=!1,e.each(s.sortables,function(){this.refreshPositions()}))})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,i,s){var n=e("body"),a=s.options;n.css("cursor")&&(a._cursor=n.css("cursor")),n.css("cursor",a.cursor)},stop:function(t,i,s){var n=s.options;n._cursor&&e("body").css("cursor",n._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("opacity")&&(a._opacity=n.css("opacity")),n.css("opacity",a.opacity)},stop:function(t,i,s){var n=s.options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(e,t,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,i,s){var n=s.options,a=!1,o=s.scrollParentNotHidden[0],r=s.document[0];o!==r&&"HTML"!==o.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+o.offsetHeight-t.pageY=0;c--)h=s.snapElements[c].left-s.margins.left,l=h+s.snapElements[c].width,u=s.snapElements[c].top-s.margins.top,d=u+s.snapElements[c].height,h-m>v||g>l+m||u-m>b||y>d+m||!e.contains(s.snapElements[c].item.ownerDocument,s.snapElements[c].item)?(s.snapElements[c].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(n=m>=Math.abs(u-b),a=m>=Math.abs(d-y),o=m>=Math.abs(h-v),r=m>=Math.abs(l-g),n&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||a||o||r,"outer"!==f.snapMode&&(n=m>=Math.abs(u-y),a=m>=Math.abs(d-b),o=m>=Math.abs(h-g),r=m>=Math.abs(l-v),n&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.top=s._convertPositionTo("relative",{top:d-s.helperProportions.height,left:0}).top),o&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[c].snapping&&(n||a||o||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,e.extend(s._uiHash(),{snapItem:s.snapElements[c].item})),s.snapElements[c].snapping=n||a||o||r||p)}}),e.ui.plugin.add("draggable","stack",{start:function(t,i,s){var n,a=s.options,o=e.makeArray(e(a.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});o.length&&(n=parseInt(e(o[0]).css("zIndex"),10)||0,e(o).each(function(t){e(this).css("zIndex",n+t)}),this.css("zIndex",n+o.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i,s){var n=e(i.helper),a=s.options;n.css("zIndex")&&(a._zIndex=n.css("zIndex")),n.css("zIndex",a.zIndex)},stop:function(t,i,s){var n=s.options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}}),e.ui.draggable});
\ No newline at end of file
diff --git a/browser/js/jquery/jquery.mousewheel.min.js b/browser/js/jquery/jquery.mousewheel.min.js
deleted file mode 100644
index 03bfd60c..00000000
--- a/browser/js/jquery/jquery.mousewheel.min.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * jQuery Mousewheel 3.1.13
- *
- * Copyright 2015 jQuery Foundation and other contributors
- * Released under the MIT license.
- * http://jquery.org/license
- */
-!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
\ No newline at end of file
diff --git a/browser/js/jquery/jquery.nouislider.all.js b/browser/js/jquery/jquery.nouislider.all.js
deleted file mode 100644
index 42ba5fae..00000000
--- a/browser/js/jquery/jquery.nouislider.all.js
+++ /dev/null
@@ -1,2296 +0,0 @@
-/*! noUiSlider - 7.0.3 - 2014-09-11 16:30:11 */
-/* With rate mod @ 1561 (Jean-Emmanuel Doucet) */
-
-(function(){
-
- 'use strict';
-
-var
-/** @const */ FormatOptions = [
- 'decimals',
- 'thousand',
- 'mark',
- 'prefix',
- 'postfix',
- 'encoder',
- 'decoder',
- 'negativeBefore',
- 'negative',
- 'edit',
- 'undo'
-];
-
-
-
-// General
-
- // Reverse a string
- function strReverse ( a ) {
- return a.split('').reverse().join('');
- }
-
- // Check if a string starts with a specified prefix.
- function strStartsWith ( input, match ) {
- return input.substring(0, match.length) === match;
- }
-
- // Check is a string ends in a specified postfix.
- function strEndsWith ( input, match ) {
- return input.slice(-1 * match.length) === match;
- }
-
- // Throw an error if formatting options are incompatible.
- function throwEqualError( F, a, b ) {
- if ( (F[a] || F[b]) && (F[a] === F[b]) ) {
- throw new Error(a);
- }
- }
-
- // Check if a number is finite and not NaN
- function isValidNumber ( input ) {
- return typeof input === 'number' && isFinite( input );
- }
-
- // Provide rounding-accurate toFixed method.
- function toFixed ( value, decimals ) {
- var scale = Math.pow(10, decimals);
- return ( Math.round(value * scale) / scale).toFixed( decimals );
- }
-
-
-// Formatting
-
- // Accept a number as input, output formatted string.
- function formatTo ( decimals, thousand, mark, prefix, postfix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {
-
- var originalInput = input, inputIsNegative, inputPieces, inputBase, inputDecimals = '', output = '';
-
- // Apply user encoder to the input.
- // Expected outcome: number.
- if ( encoder ) {
- input = encoder(input);
- }
-
- // Stop if no valid number was provided, the number is infinite or NaN.
- if ( !isValidNumber(input) ) {
- return false;
- }
-
- // Rounding away decimals might cause a value of -0
- // when using very small ranges. Remove those cases.
- if ( decimals && parseFloat(input.toFixed(decimals)) === 0 ) {
- input = 0;
- }
-
- // Formatting is done on absolute numbers,
- // decorated by an optional negative symbol.
- if ( input < 0 ) {
- inputIsNegative = true;
- input = Math.abs(input);
- }
-
- // Reduce the number of decimals to the specified option.
- if ( decimals !== false ) {
- input = toFixed( input, decimals );
- }
-
- // Transform the number into a string, so it can be split.
- input = input.toString();
-
- // Break the number on the decimal separator.
- if ( input.indexOf('.') !== -1 ) {
- inputPieces = input.split('.');
-
- inputBase = inputPieces[0];
-
- if ( mark ) {
- inputDecimals = mark + inputPieces[1];
- }
-
- } else {
-
- // If it isn't split, the entire number will do.
- inputBase = input;
- }
-
- // Group numbers in sets of three.
- if ( thousand ) {
- inputBase = strReverse(inputBase).match(/.{1,3}/g);
- inputBase = strReverse(inputBase.join( strReverse( thousand ) ));
- }
-
- // If the number is negative, prefix with negation symbol.
- if ( inputIsNegative && negativeBefore ) {
- output += negativeBefore;
- }
-
- // Prefix the number
- if ( prefix ) {
- output += prefix;
- }
-
- // Normal negative option comes after the prefix. Defaults to '-'.
- if ( inputIsNegative && negative ) {
- output += negative;
- }
-
- // Append the actual number.
- output += inputBase;
- output += inputDecimals;
-
- // Apply the postfix.
- if ( postfix ) {
- output += postfix;
- }
-
- // Run the output through a user-specified post-formatter.
- if ( edit ) {
- output = edit ( output, originalInput );
- }
-
- // All done.
- return output;
- }
-
- // Accept a sting as input, output decoded number.
- function formatFrom ( decimals, thousand, mark, prefix, postfix, encoder, decoder, negativeBefore, negative, edit, undo, input ) {
-
- var originalInput = input, inputIsNegative, output = '';
-
- // User defined pre-decoder. Result must be a non empty string.
- if ( undo ) {
- input = undo(input);
- }
-
- // Test the input. Can't be empty.
- if ( !input || typeof input !== 'string' ) {
- return false;
- }
-
- // If the string starts with the negativeBefore value: remove it.
- // Remember is was there, the number is negative.
- if ( negativeBefore && strStartsWith(input, negativeBefore) ) {
- input = input.replace(negativeBefore, '');
- inputIsNegative = true;
- }
-
- // Repeat the same procedure for the prefix.
- if ( prefix && strStartsWith(input, prefix) ) {
- input = input.replace(prefix, '');
- }
-
- // And again for negative.
- if ( negative && strStartsWith(input, negative) ) {
- input = input.replace(negative, '');
- inputIsNegative = true;
- }
-
- // Remove the postfix.
- // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice
- if ( postfix && strEndsWith(input, postfix) ) {
- input = input.slice(0, -1 * postfix.length);
- }
-
- // Remove the thousand grouping.
- if ( thousand ) {
- input = input.split(thousand).join('');
- }
-
- // Set the decimal separator back to period.
- if ( mark ) {
- input = input.replace(mark, '.');
- }
-
- // Prepend the negative symbol.
- if ( inputIsNegative ) {
- output += '-';
- }
-
- // Add the number
- output += input;
-
- // Trim all non-numeric characters (allow '.' and '-');
- output = output.replace(/[^0-9\.\-.]/g, '');
-
- // The value contains no parse-able number.
- if ( output === '' ) {
- return false;
- }
-
- // Covert to number.
- output = Number(output);
-
- // Run the user-specified post-decoder.
- if ( decoder ) {
- output = decoder(output);
- }
-
- // Check is the output is valid, otherwise: return false.
- if ( !isValidNumber(output) ) {
- return false;
- }
-
- return output;
- }
-
-
-// Framework
-
- // Validate formatting options
- function validate ( inputOptions ) {
-
- var i, optionName, optionValue,
- filteredOptions = {};
-
- for ( i = 0; i < FormatOptions.length; i+=1 ) {
-
- optionName = FormatOptions[i];
- optionValue = inputOptions[optionName];
-
- if ( optionValue === undefined ) {
-
- // Only default if negativeBefore isn't set.
- if ( optionName === 'negative' && !filteredOptions.negativeBefore ) {
- filteredOptions[optionName] = '-';
- // Don't set a default for mark when 'thousand' is set.
- } else if ( optionName === 'mark' && filteredOptions.thousand !== '.' ) {
- filteredOptions[optionName] = '.';
- } else {
- filteredOptions[optionName] = false;
- }
-
- // Floating points in JS are stable up to 7 decimals.
- } else if ( optionName === 'decimals' ) {
- if ( optionValue >= 0 && optionValue < 8 ) {
- filteredOptions[optionName] = optionValue;
- } else {
- throw new Error(optionName);
- }
-
- // These options, when provided, must be functions.
- } else if ( optionName === 'encoder' || optionName === 'decoder' || optionName === 'edit' || optionName === 'undo' ) {
- if ( typeof optionValue === 'function' ) {
- filteredOptions[optionName] = optionValue;
- } else {
- throw new Error(optionName);
- }
-
- // Other options are strings.
- } else {
-
- if ( typeof optionValue === 'string' ) {
- filteredOptions[optionName] = optionValue;
- } else {
- throw new Error(optionName);
- }
- }
- }
-
- // Some values can't be extracted from a
- // string if certain combinations are present.
- throwEqualError(filteredOptions, 'mark', 'thousand');
- throwEqualError(filteredOptions, 'prefix', 'negative');
- throwEqualError(filteredOptions, 'prefix', 'negativeBefore');
-
- return filteredOptions;
- }
-
- // Pass all options as function arguments
- function passAll ( options, method, input ) {
- var i, args = [];
-
- // Add all options in order of FormatOptions
- for ( i = 0; i < FormatOptions.length; i+=1 ) {
- args.push(options[FormatOptions[i]]);
- }
-
- // Append the input, then call the method, presenting all
- // options as arguments.
- args.push(input);
- return method.apply('', args);
- }
-
- /** @constructor */
- function wNumb ( options ) {
-
- if ( !(this instanceof wNumb) ) {
- return new wNumb ( options );
- }
-
- if ( typeof options !== "object" ) {
- return;
- }
-
- options = validate(options);
-
- // Call 'formatTo' with proper arguments.
- this.to = function ( input ) {
- return passAll(options, formatTo, input);
- };
-
- // Call 'formatFrom' with proper arguments.
- this.from = function ( input ) {
- return passAll(options, formatFrom, input);
- };
- }
-
- /** @export */
- window.wNumb = wNumb;
-
-}());
-
-/*jslint browser: true */
-/*jslint white: true */
-
-(function( $ ){
-
- 'use strict';
-
-// Helpers
-
- // Test in an object is an instance of jQuery or Zepto.
- function isInstance ( a ) {
- return a instanceof $ || ( $.zepto && $.zepto.isZ(a) );
- }
-
-
-// Link types
-
- function fromPrefix ( target, method ) {
-
- // If target is a string, a new hidden input will be created.
- if ( typeof target === 'string' && target.indexOf('-inline-') === 0 ) {
-
- // By default, use the 'html' method.
- this.method = method || 'html';
-
- // Use jQuery to create the element
- this.target = this.el = $( target.replace('-inline-', '') || '' );
-
- return true;
- }
- }
-
- function fromString ( target ) {
-
- // If the string doesn't begin with '-', which is reserved, add a new hidden input.
- if ( typeof target === 'string' && target.indexOf('-') !== 0 ) {
-
- this.method = 'val';
-
- var element = document.createElement('input');
- element.name = target;
- element.type = 'hidden';
- this.target = this.el = $(element);
-
- return true;
- }
- }
-
- function fromFunction ( target ) {
-
- // The target can also be a function, which will be called.
- if ( typeof target === 'function' ) {
- this.target = false;
- this.method = target;
-
- return true;
- }
- }
-
- function fromInstance ( target, method ) {
-
- if ( isInstance( target ) && !method ) {
-
- // If a jQuery/Zepto input element is provided, but no method is set,
- // the element can assume it needs to respond to 'change'...
- if ( target.is('input, select, textarea') ) {
-
- // Default to .val if this is an input element.
- this.method = 'val';
-
- // Fire the API changehandler when the target changes.
- this.target = target.on('change.liblink', this.changeHandler);
-
- } else {
-
- this.target = target;
-
- // If no method is set, and we are not auto-binding an input, default to 'html'.
- this.method = 'html';
- }
-
- return true;
- }
- }
-
- function fromInstanceMethod ( target, method ) {
-
- // The method must exist on the element.
- if ( isInstance( target ) &&
- (typeof method === 'function' ||
- (typeof method === 'string' && target[method]))
- ) {
- this.method = method;
- this.target = target;
-
- return true;
- }
- }
-
-var
-/** @const */
- creationFunctions = [fromPrefix, fromString, fromFunction, fromInstance, fromInstanceMethod];
-
-
-// Link Instance
-
-/** @constructor */
- function Link ( target, method, format ) {
-
- var that = this, valid = false;
-
- // Forward calls within scope.
- this.changeHandler = function ( changeEvent ) {
- var decodedValue = that.formatInstance.from( $(this).val() );
-
- // If the value is invalid, stop this event, as well as it's propagation.
- if ( decodedValue === false || isNaN(decodedValue) ) {
-
- // Reset the value.
- $(this).val(that.lastSetValue);
- return false;
- }
-
- that.changeHandlerMethod.call( '', changeEvent, decodedValue );
- };
-
- // See if this Link needs individual targets based on its usage.
- // If so, return the element that needs to be copied by the
- // implementing interface.
- // Default the element to false.
- this.el = false;
-
- // Store the formatter, or use the default.
- this.formatInstance = format;
-
- // Try all Link types.
- /*jslint unparam: true*/
- $.each(creationFunctions, function(i, fn){
- valid = fn.call(that, target, method);
- return !valid;
- });
- /*jslint unparam: false*/
-
- // Nothing matched, throw error.
- if ( !valid ) {
- throw new RangeError("(Link) Invalid Link.");
- }
- }
-
- // Provides external items with the object value.
- Link.prototype.set = function ( value ) {
-
- // Ignore the value, so only the passed-on arguments remain.
- var args = Array.prototype.slice.call( arguments ),
- additionalArgs = args.slice(1);
-
- // Store some values. The actual, numerical value,
- // the formatted value and the parameters for use in 'resetValue'.
- // Slice additionalArgs to break the relation.
- this.lastSetValue = this.formatInstance.to( value );
-
- // Prepend the value to the function arguments.
- additionalArgs.unshift(
- this.lastSetValue
- );
-
- // When target is undefined, the target was a function.
- // In that case, provided the object as the calling scope.
- // Branch between writing to a function or an object.
- ( typeof this.method === 'function' ?
- this.method :
- this.target[ this.method ] ).apply( this.target, additionalArgs );
- };
-
-
-// Developer API
-
-/** @constructor */
- function LinkAPI ( origin ) {
- this.items = [];
- this.elements = [];
- this.origin = origin;
- }
-
- LinkAPI.prototype.push = function( item, element ) {
- this.items.push(item);
-
- // Prevent 'false' elements
- if ( element ) {
- this.elements.push(element);
- }
- };
-
- LinkAPI.prototype.reconfirm = function ( flag ) {
- var i;
- for ( i = 0; i < this.elements.length; i += 1 ) {
- this.origin.LinkConfirm(flag, this.elements[i]);
- }
- };
-
- LinkAPI.prototype.remove = function ( flag ) {
- var i;
- for ( i = 0; i < this.items.length; i += 1 ) {
- this.items[i].target.off('.liblink');
- }
- for ( i = 0; i < this.elements.length; i += 1 ) {
- this.elements[i].remove();
- }
- };
-
- LinkAPI.prototype.change = function ( value ) {
-
- if ( this.origin.LinkIsEmitting ) {
- return false;
- }
-
- this.origin.LinkIsEmitting = true;
-
- var args = Array.prototype.slice.call( arguments, 1 ), i;
- args.unshift( value );
-
- // Write values to serialization Links.
- // Convert the value to the correct relative representation.
- for ( i = 0; i < this.items.length; i += 1 ) {
- this.items[i].set.apply(this.items[i], args);
- }
-
- this.origin.LinkIsEmitting = false;
- };
-
-
-// jQuery plugin
-
- function binder ( flag, target, method, format ){
-
- if ( flag === 0 ) {
- flag = this.LinkDefaultFlag;
- }
-
- // Create a list of API's (if it didn't exist yet);
- if ( !this.linkAPI ) {
- this.linkAPI = {};
- }
-
- // Add an API point.
- if ( !this.linkAPI[flag] ) {
- this.linkAPI[flag] = new LinkAPI(this);
- }
-
- var linkInstance = new Link ( target, method, format || this.LinkDefaultFormatter );
-
- // Default the calling scope to the linked object.
- if ( !linkInstance.target ) {
- linkInstance.target = $(this);
- }
-
- // If the Link requires creation of a new element,
- // Pass the element and request confirmation to get the changehandler.
- // Set the method to be called when a Link changes.
- linkInstance.changeHandlerMethod = this.LinkConfirm( flag, linkInstance.el );
-
- // Store the linkInstance in the flagged list.
- this.linkAPI[flag].push( linkInstance, linkInstance.el );
-
- // Now that Link have been connected, request an update.
- this.LinkUpdate( flag );
- }
-
- /** @export */
- $.fn.Link = function( flag ){
-
- var that = this;
-
- // Delete all linkAPI
- if ( flag === false ) {
-
- return that.each(function(){
-
- // .Link(false) can be called on elements without Links.
- // When that happens, the objects can't be looped.
- if ( !this.linkAPI ) {
- return;
- }
-
- $.map(this.linkAPI, function(api){
- api.remove();
- });
-
- delete this.linkAPI;
- });
- }
-
- if ( flag === undefined ) {
-
- flag = 0;
-
- } else if ( typeof flag !== 'string') {
-
- throw new Error("Flag must be string.");
- }
-
- return {
- to: function( a, b, c ){
- return that.each(function(){
- binder.call(this, flag, a, b, c);
- });
- }
- };
- };
-
-}( window.jQuery || window.Zepto ));
-
-/*jslint browser: true */
-/*jslint white: true */
-
-(function( $ ){
-
- 'use strict';
-
-
- // Removes duplicates from an array.
- function unique(array) {
- return $.grep(array, function(el, index) {
- return index === $.inArray(el, array);
- });
- }
-
- // Round a value to the closest 'to'.
- function closest ( value, to ) {
- return Math.round(value / to) * to;
- }
-
- // Checks whether a value is numerical.
- function isNumeric ( a ) {
- return typeof a === 'number' && !isNaN( a ) && isFinite( a );
- }
-
- // Rounds a number to 7 supported decimals.
- function accurateNumber( number ) {
- var p = Math.pow(10, 7);
- return Number((Math.round(number*p)/p).toFixed(7));
- }
-
- // Sets a class and removes it after [duration] ms.
- function addClassFor ( element, className, duration ) {
- element.addClass(className);
- setTimeout(function(){
- element.removeClass(className);
- }, duration);
- }
-
- // Limits a value to 0 - 100
- function limit ( a ) {
- return Math.max(Math.min(a, 100), 0);
- }
-
- // Wraps a variable as an array, if it isn't one yet.
- function asArray ( a ) {
- return $.isArray(a) ? a : [a];
- }
-
-
- var
- // Cache the document selector;
- /** @const */
- doc = $(document),
- // Make a backup of the original jQuery/Zepto .val() method.
- /** @const */
- $val = $.fn.val,
- // Namespace for binding and unbinding slider events;
- /** @const */
- namespace = '.nui',
- // Determine the events to bind. IE11 implements pointerEvents without
- // a prefix, which breaks compatibility with the IE10 implementation.
- /** @const */
- actions = window.navigator.pointerEnabled ? {
- start: 'pointerdown',
- move: 'pointermove',
- end: 'pointerup'
- } : window.navigator.msPointerEnabled ? {
- start: 'MSPointerDown',
- move: 'MSPointerMove',
- end: 'MSPointerUp'
- } : {
- start: 'mousedown touchstart',
- move: 'mousemove touchmove',
- end: 'mouseup touchend'
- },
- // Re-usable list of classes;
- /** @const */
- Classes = [
-/* 0 */ 'noUi-target'
-/* 1 */ ,'noUi-base'
-/* 2 */ ,'noUi-origin'
-/* 3 */ ,'noUi-handle'
-/* 4 */ ,'noUi-horizontal'
-/* 5 */ ,'noUi-vertical'
-/* 6 */ ,'noUi-background'
-/* 7 */ ,'noUi-connect'
-/* 8 */ ,'noUi-ltr'
-/* 9 */ ,'noUi-rtl'
-/* 10 */ ,'noUi-dragable'
-/* 11 */ ,''
-/* 12 */ ,'noUi-state-drag'
-/* 13 */ ,''
-/* 14 */ ,'noUi-state-tap'
-/* 15 */ ,'noUi-active'
-/* 16 */ ,''
-/* 17 */ ,'noUi-stacking'
- ];
-
-
-// Value calculation
-
- // Determine the size of a sub-range in relation to a full range.
- function subRangeRatio ( pa, pb ) {
- return (100 / (pb - pa));
- }
-
- // (percentage) How many percent is this value of this range?
- function fromPercentage ( range, value ) {
- return (value * 100) / ( range[1] - range[0] );
- }
-
- // (percentage) Where is this value on this range?
- function toPercentage ( range, value ) {
- return fromPercentage( range, range[0] < 0 ?
- value + Math.abs(range[0]) :
- value - range[0] );
- }
-
- // (value) How much is this percentage on this range?
- function isPercentage ( range, value ) {
- return ((value * ( range[1] - range[0] )) / 100) + range[0];
- }
-
-
-// Range conversion
-
- function getJ ( value, arr ) {
-
- var j = 1;
-
- while ( value >= arr[j] ){
- j += 1;
- }
-
- return j;
- }
-
- // (percentage) Input a value, find where, on a scale of 0-100, it applies.
- function toStepping ( xVal, xPct, value ) {
-
- if ( value >= xVal.slice(-1)[0] ){
- return 100;
- }
-
- var j = getJ( value, xVal ), va, vb, pa, pb;
-
- va = xVal[j-1];
- vb = xVal[j];
- pa = xPct[j-1];
- pb = xPct[j];
-
- return pa + (toPercentage([va, vb], value) / subRangeRatio (pa, pb));
- }
-
- // (value) Input a percentage, find where it is on the specified range.
- function fromStepping ( xVal, xPct, value ) {
-
- // There is no range group that fits 100
- if ( value >= 100 ){
- return xVal.slice(-1)[0];
- }
-
- var j = getJ( value, xPct ), va, vb, pa, pb;
-
- va = xVal[j-1];
- vb = xVal[j];
- pa = xPct[j-1];
- pb = xPct[j];
-
- return isPercentage([va, vb], (value - pa) * subRangeRatio (pa, pb));
- }
-
- // (percentage) Get the step that applies at a certain value.
- function getStep ( xPct, xSteps, snap, value ) {
-
- if ( value === 100 ) {
- return value;
- }
-
- var j = getJ( value, xPct ), a, b;
-
- // If 'snap' is set, steps are used as fixed points on the slider.
- if ( snap ) {
-
- a = xPct[j-1];
- b = xPct[j];
-
- // Find the closest position, a or b.
- if ((value - a) > ((b-a)/2)){
- return b;
- }
-
- return a;
- }
-
- if ( !xSteps[j-1] ){
- return value;
- }
-
- return xPct[j-1] + closest(
- value - xPct[j-1],
- xSteps[j-1]
- );
- }
-
-
-// Entry parsing
-
- function handleEntryPoint ( index, value, that ) {
-
- var percentage;
-
- // Wrap numerical input in an array.
- if ( typeof value === "number" ) {
- value = [value];
- }
-
- // Reject any invalid input, by testing whether value is an array.
- if ( Object.prototype.toString.call( value ) !== '[object Array]' ){
- throw new Error("noUiSlider: 'range' contains invalid value.");
- }
-
- // Covert min/max syntax to 0 and 100.
- if ( index === 'min' ) {
- percentage = 0;
- } else if ( index === 'max' ) {
- percentage = 100;
- } else {
- percentage = parseFloat( index );
- }
-
- // Check for correct input.
- if ( !isNumeric( percentage ) || !isNumeric( value[0] ) ) {
- throw new Error("noUiSlider: 'range' value isn't numeric.");
- }
-
- // Store values.
- that.xPct.push( percentage );
- that.xVal.push( value[0] );
-
- // NaN will evaluate to false too, but to keep
- // logging clear, set step explicitly. Make sure
- // not to override the 'step' setting with false.
- if ( !percentage ) {
- if ( !isNaN( value[1] ) ) {
- that.xSteps[0] = value[1];
- }
- } else {
- that.xSteps.push( isNaN(value[1]) ? false : value[1] );
- }
- }
-
- function handleStepPoint ( i, n, that ) {
-
- // Ignore 'false' stepping.
- if ( !n ) {
- return true;
- }
-
- // Factor to range ratio
- that.xSteps[i] = fromPercentage([
- that.xVal[i]
- ,that.xVal[i+1]
- ], n) / subRangeRatio (
- that.xPct[i],
- that.xPct[i+1] );
- }
-
-
-// Interface
-
- // The interface to Spectrum handles all direction-based
- // conversions, so the above values are unaware.
-
- function Spectrum ( entry, snap, direction, singleStep ) {
-
- this.xPct = [];
- this.xVal = [];
- this.xSteps = [ singleStep || false ];
- this.xNumSteps = [ false ];
-
- this.snap = snap;
- this.direction = direction;
-
- var that = this, index;
-
- // Loop all entries.
- for ( index in entry ) {
- if ( entry.hasOwnProperty(index) ) {
- handleEntryPoint(index, entry[index], that);
- }
- }
-
- // Store the actual step values.
- that.xNumSteps = that.xSteps.slice(0);
-
- for ( index in that.xNumSteps ) {
- if ( that.xNumSteps.hasOwnProperty(index) ) {
- handleStepPoint(Number(index), that.xNumSteps[index], that);
- }
- }
- }
-
- Spectrum.prototype.getMargin = function ( value ) {
- return this.xPct.length === 2 ? fromPercentage(this.xVal, value) : false;
- };
-
- Spectrum.prototype.toStepping = function ( value ) {
-
- value = toStepping( this.xVal, this.xPct, value );
-
- // Invert the value if this is a right-to-left slider.
- if ( this.direction ) {
- value = 100 - value;
- }
-
- return value;
- };
-
- Spectrum.prototype.fromStepping = function ( value ) {
-
- // Invert the value if this is a right-to-left slider.
- if ( this.direction ) {
- value = 100 - value;
- }
-
- return accurateNumber(fromStepping( this.xVal, this.xPct, value ));
- };
-
- Spectrum.prototype.getStep = function ( value ) {
-
- // Find the proper step for rtl sliders by search in inverse direction.
- // Fixes issue #262.
- if ( this.direction ) {
- value = 100 - value;
- }
-
- value = getStep(this.xPct, this.xSteps, this.snap, value );
-
- if ( this.direction ) {
- value = 100 - value;
- }
-
- return value;
- };
-
- Spectrum.prototype.getApplicableStep = function ( value ) {
-
- // If the value is 100%, return the negative step twice.
- var j = getJ(value, this.xPct), offset = value === 100 ? 2 : 1;
- return [this.xNumSteps[j-2], this.xVal[j-offset], this.xNumSteps[j-offset]];
- };
-
- // Outside testing
- Spectrum.prototype.convert = function ( value ) {
- return this.getStep(this.toStepping(value));
- };
-
-/* Every input option is tested and parsed. This'll prevent
- endless validation in internal methods. These tests are
- structured with an item for every option available. An
- option can be marked as required by setting the 'r' flag.
- The testing function is provided with three arguments:
- - The provided value for the option;
- - A reference to the options object;
- - The name for the option;
-
- The testing function returns false when an error is detected,
- or true when everything is OK. It can also modify the option
- object, to make sure all values can be correctly looped elsewhere. */
-
- /** @const */
- var defaultFormatter = { 'to': function( value ){
- return value.toFixed(2);
- }, 'from': Number };
-
- function testStep ( parsed, entry ) {
-
- if ( !isNumeric( entry ) ) {
- throw new Error("noUiSlider: 'step' is not numeric.");
- }
-
- // The step option can still be used to set stepping
- // for linear sliders. Overwritten if set in 'range'.
- parsed.singleStep = entry;
- }
-
- function testRange ( parsed, entry ) {
-
- // Filter incorrect input.
- if ( typeof entry !== 'object' || $.isArray(entry) ) {
- throw new Error("noUiSlider: 'range' is not an object.");
- }
-
- // Catch missing start or end.
- if ( entry.min === undefined || entry.max === undefined ) {
- throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");
- }
-
- parsed.spectrum = new Spectrum(entry, parsed.snap, parsed.dir, parsed.singleStep);
- }
-
- function testStart ( parsed, entry ) {
-
- entry = asArray(entry);
-
- // Validate input. Values aren't tested, as the public .val method
- // will always provide a valid location.
- if ( !$.isArray( entry ) || !entry.length || entry.length > 2 ) {
- throw new Error("noUiSlider: 'start' option is incorrect.");
- }
-
- // Store the number of handles.
- parsed.handles = entry.length;
-
- // When the slider is initialized, the .val method will
- // be called with the start options.
- parsed.start = entry;
- }
-
- function testSnap ( parsed, entry ) {
-
- // Enforce 100% stepping within subranges.
- parsed.snap = entry;
-
- if ( typeof entry !== 'boolean' ){
- throw new Error("noUiSlider: 'snap' option must be a boolean.");
- }
- }
-
- function testAnimate ( parsed, entry ) {
-
- // Enforce 100% stepping within subranges.
- parsed.animate = entry;
-
- if ( typeof entry !== 'boolean' ){
- throw new Error("noUiSlider: 'animate' option must be a boolean.");
- }
- }
-
- function testConnect ( parsed, entry ) {
-
- if ( entry === 'lower' && parsed.handles === 1 ) {
- parsed.connect = 1;
- } else if ( entry === 'upper' && parsed.handles === 1 ) {
- parsed.connect = 2;
- } else if ( entry === true && parsed.handles === 2 ) {
- parsed.connect = 3;
- } else if ( entry === false ) {
- parsed.connect = 0;
- } else {
- throw new Error("noUiSlider: 'connect' option doesn't match handle count.");
- }
- }
-
- function testOrientation ( parsed, entry ) {
-
- // Set orientation to an a numerical value for easy
- // array selection.
- switch ( entry ){
- case 'horizontal':
- parsed.ort = 0;
- break;
- case 'vertical':
- parsed.ort = 1;
- break;
- default:
- throw new Error("noUiSlider: 'orientation' option is invalid.");
- }
- }
-
- function testMargin ( parsed, entry ) {
-
- if ( !isNumeric(entry) ){
- throw new Error("noUiSlider: 'margin' option must be numeric.");
- }
-
- parsed.margin = parsed.spectrum.getMargin(entry);
-
- if ( !parsed.margin ) {
- throw new Error("noUiSlider: 'margin' option is only supported on linear sliders.");
- }
- }
-
- function testLimit ( parsed, entry ) {
-
- if ( !isNumeric(entry) ){
- throw new Error("noUiSlider: 'limit' option must be numeric.");
- }
-
- parsed.limit = parsed.spectrum.getMargin(entry);
-
- if ( !parsed.limit ) {
- throw new Error("noUiSlider: 'limit' option is only supported on linear sliders.");
- }
- }
-
- function testDirection ( parsed, entry ) {
-
- // Set direction as a numerical value for easy parsing.
- // Invert connection for RTL sliders, so that the proper
- // handles get the connect/background classes.
- switch ( entry ) {
- case 'ltr':
- parsed.dir = 0;
- break;
- case 'rtl':
- parsed.dir = 1;
- parsed.connect = [0,2,1,3][parsed.connect];
- break;
- default:
- throw new Error("noUiSlider: 'direction' option was not recognized.");
- }
- }
-
- function testBehaviour ( parsed, entry ) {
-
- // Make sure the input is a string.
- if ( typeof entry !== 'string' ) {
- throw new Error("noUiSlider: 'behaviour' must be a string containing options.");
- }
-
- // Check if the string contains any keywords.
- // None are required.
- var tap = entry.indexOf('tap') >= 0,
- drag = entry.indexOf('drag') >= 0,
- fixed = entry.indexOf('fixed') >= 0,
- snap = entry.indexOf('snap') >= 0;
-
- parsed.events = {
- tap: tap || snap,
- drag: drag,
- fixed: fixed,
- snap: snap
- };
- }
-
- function testFormat ( parsed, entry ) {
-
- parsed.format = entry;
-
- // Any object with a to and from method is supported.
- if ( typeof entry.to === 'function' && typeof entry.from === 'function' ) {
- return true;
- }
-
- throw new Error( "noUiSlider: 'format' requires 'to' and 'from' methods.");
- }
-
- // Test all developer settings and parse to assumption-safe values.
- function testOptions ( options ) {
-
- var parsed = {
- margin: 0,
- limit: 0,
- animate: true,
- format: defaultFormatter
- }, tests;
-
- // Tests are executed in the order they are presented here.
- tests = {
- 'step': { r: false, t: testStep },
- 'start': { r: true, t: testStart },
- 'connect': { r: true, t: testConnect },
- 'direction': { r: true, t: testDirection },
- 'snap': { r: false, t: testSnap },
- 'animate': { r: false, t: testAnimate },
- 'range': { r: true, t: testRange },
- 'orientation': { r: false, t: testOrientation },
- 'margin': { r: false, t: testMargin },
- 'limit': { r: false, t: testLimit },
- 'behaviour': { r: true, t: testBehaviour },
- 'format': { r: false, t: testFormat }
- };
-
- // Set defaults where applicable.
- options = $.extend({
- 'connect': false,
- 'direction': 'ltr',
- 'behaviour': 'tap',
- 'orientation': 'horizontal'
- }, options);
-
- // Run all options through a testing mechanism to ensure correct
- // input. It should be noted that options might get modified to
- // be handled properly. E.g. wrapping integers in arrays.
- $.each( tests, function( name, test ){
-
- // If the option isn't set, but it is required, throw an error.
- if ( options[name] === undefined ) {
-
- if ( test.r ) {
- throw new Error("noUiSlider: '" + name + "' is required.");
- }
-
- return true;
- }
-
- test.t( parsed, options[name] );
- });
-
- // Pre-define the styles.
- parsed.style = parsed.ort ? 'top' : 'left';
-
- return parsed;
- }
-
-// Class handling
-
- // Delimit proposed values for handle positions.
- function getPositions ( a, b, delimit ) {
-
- // Add movement to current position.
- var c = a + b[0], d = a + b[1];
-
- // Only alter the other position on drag,
- // not on standard sliding.
- if ( delimit ) {
- if ( c < 0 ) {
- d += Math.abs(c);
- }
- if ( d > 100 ) {
- c -= ( d - 100 );
- }
-
- // Limit values to 0 and 100.
- return [limit(c), limit(d)];
- }
-
- return [c,d];
- }
-
-
-// Event handling
-
- // Provide a clean event with standardized offset values.
- function fixEvent ( e ) {
-
- // Prevent scrolling and panning on touch events, while
- // attempting to slide. The tap event also depends on this.
- e.preventDefault();
-
- // Filter the event to register the type, which can be
- // touch, mouse or pointer. Offset changes need to be
- // made on an event specific basis.
- var touch = e.type.indexOf('touch') === 0
- ,mouse = e.type.indexOf('mouse') === 0
- ,pointer = e.type.indexOf('pointer') === 0
- ,x,y, event = e;
-
- // IE10 implemented pointer events with a prefix;
- if ( e.type.indexOf('MSPointer') === 0 ) {
- pointer = true;
- }
-
- // Get the originalEvent, if the event has been wrapped
- // by jQuery. Zepto doesn't wrap the event.
- if ( e.originalEvent ) {
- e = e.originalEvent;
- }
-
- if ( touch ) {
- // noUiSlider supports one movement at a time,
- // so we can select the first 'changedTouch'.
- x = e.changedTouches[0].pageX;
- y = e.changedTouches[0].pageY;
- }
-
- if ( mouse || pointer ) {
-
- // Polyfill the pageXOffset and pageYOffset
- // variables for IE7 and IE8;
- if( !pointer && window.pageXOffset === undefined ){
- window.pageXOffset = document.documentElement.scrollLeft;
- window.pageYOffset = document.documentElement.scrollTop;
- }
-
- x = e.clientX + window.pageXOffset;
- y = e.clientY + window.pageYOffset;
- }
-
- event.points = [x, y];
- event.cursor = mouse;
-
- return event;
- }
-
-
-// DOM additions
-
- // Append a handle to the base.
- function addHandle ( direction, index ) {
-
- var handle = $('').addClass( Classes[2] ),
- additions = [ '-lower', '-upper' ];
-
- if ( direction ) {
- additions.reverse();
- }
-
- handle.children().addClass(
- Classes[3] + " " + Classes[3]+additions[index]
- );
-
- return handle;
- }
-
- // Add the proper connection classes.
- function addConnection ( connect, target, handles ) {
-
- // Apply the required connection classes to the elements
- // that need them. Some classes are made up for several
- // segments listed in the class list, to allow easy
- // renaming and provide a minor compression benefit.
- switch ( connect ) {
- case 1: target.addClass( Classes[7] );
- handles[0].addClass( Classes[6] );
- break;
- case 3: handles[1].addClass( Classes[6] );
- /* falls through */
- case 2: handles[0].addClass( Classes[7] );
- /* falls through */
- case 0: target.addClass(Classes[6]);
- break;
- }
- }
-
- // Add handles to the slider base.
- function addHandles ( nrHandles, direction, base ) {
-
- var index, handles = [];
-
- // Append handles.
- for ( index = 0; index < nrHandles; index += 1 ) {
-
- // Keep a list of all added handles.
- handles.push( addHandle( direction, index ).appendTo(base) );
- }
-
- return handles;
- }
-
- // Initialize a single slider.
- function addSlider ( direction, orientation, target ) {
-
- // Apply classes and data to the target.
- target.addClass([
- Classes[0],
- Classes[8 + direction],
- Classes[4 + orientation]
- ].join(' '));
-
- return $('').appendTo(target).addClass( Classes[1] );
- }
-
-function closure ( target, options, originalOptions ){
-
-// Internal variables
-
- // All variables local to 'closure' are marked $.
- var $Target = $(target),
- $Locations = [-1, -1],
- $Base,
- $Handles,
- $Spectrum = options.spectrum,
- $Values = [],
- // libLink. For rtl sliders, 'lower' and 'upper' should not be inverted
- // for one-handle sliders, so trim 'upper' it that case.
- triggerPos = ['lower', 'upper'].slice(0, options.handles);
-
- // Invert the libLink connection for rtl sliders.
- if ( options.dir ) {
- triggerPos.reverse();
- }
-
-// Helpers
-
- // Shorthand for base dimensions.
- function baseSize ( ) {
- return $Base[['width', 'height'][options.ort]]();
- }
-
- // External event handling
- function fireEvents ( events ) {
-
- // Use the external api to get the values.
- // Wrap the values in an array, as .trigger takes
- // only one additional argument.
- var index, values = [ $Target.val() ];
-
- for ( index = 0; index < events.length; index += 1 ){
- $Target.trigger(events[index], values);
- }
- }
-
- // Returns the input array, respecting the slider direction configuration.
- function inSliderOrder ( values ) {
-
- // If only one handle is used, return a single value.
- if ( values.length === 1 ){
- return values[0];
- }
-
- if ( options.dir ) {
- return values.reverse();
- }
-
- return values;
- }
-
-// libLink integration
-
- // Create a new function which calls .val on input change.
- function createChangeHandler ( trigger ) {
- return function ( ignore, value ){
- // Determine which array position to 'null' based on 'trigger'.
- $Target.val( [ trigger ? null : value, trigger ? value : null ], true );
- };
- }
-
- // Called by libLink when it wants a set of links updated.
- function linkUpdate ( flag ) {
-
- var trigger = $.inArray(flag, triggerPos);
-
- // The API might not have been set yet.
- if ( $Target[0].linkAPI && $Target[0].linkAPI[flag] ) {
- $Target[0].linkAPI[flag].change(
- $Values[trigger],
- $Handles[trigger].children(),
- $Target
- );
- }
- }
-
- // Called by libLink to append an element to the slider.
- function linkConfirm ( flag, element ) {
-
- // Find the trigger for the passed flag.
- var trigger = $.inArray(flag, triggerPos);
-
- // If set, append the element to the handle it belongs to.
- if ( element ) {
- element.appendTo( $Handles[trigger].children() );
- }
-
- // The public API is reversed for rtl sliders, so the changeHandler
- // should not be aware of the inverted trigger positions.
- // On rtl slider with one handle, 'lower' should be used.
- if ( options.dir && options.handles > 1 ) {
- trigger = trigger === 1 ? 0 : 1;
- }
-
- return createChangeHandler( trigger );
- }
-
- // Place elements back on the slider.
- function reAppendLink ( ) {
-
- var i, flag;
-
- // The API keeps a list of elements: we can re-append them on rebuild.
- for ( i = 0; i < triggerPos.length; i += 1 ) {
- if ( this.linkAPI && this.linkAPI[(flag = triggerPos[i])] ) {
- this.linkAPI[flag].reconfirm(flag);
- }
- }
- }
-
- target.LinkUpdate = linkUpdate;
- target.LinkConfirm = linkConfirm;
- target.LinkDefaultFormatter = options.format;
- target.LinkDefaultFlag = 'lower';
-
- target.reappend = reAppendLink;
-
-
- // Handler for attaching events trough a proxy.
- function attach ( events, element, callback, data ) {
-
- // This function can be used to 'filter' events to the slider.
-
- // Add the noUiSlider namespace to all events.
- events = events.replace( /\s/g, namespace + ' ' ) + namespace;
-
- // Bind a closure on the target.
- return element.on( events, function( e ){
-
- // jQuery and Zepto (1) handle unset attributes differently,
- // but always falsy; #208
- if ( !!$Target.attr('disabled') ) {
- return false;
- }
-
- // Stop if an active 'tap' transition is taking place.
- if ( $Target.hasClass( Classes[14] ) ) {
- return false;
- }
-
- e = fixEvent(e);
- e.calcPoint = e.points[ options.ort ];
-
- // Call the event handler with the event [ and additional data ].
- callback ( e, data );
- });
- }
-
- // BIG FAT & UGLY MOD
- // Limit move's rate for better performances
- // It skips events, but we don't need that much precision here
- function move (event, data) {
- window.now = +new Date;
-
- if (window.last && window.now - window.last > 30) {
- window.last = window.now;
- moveP(event, data);
- } else if (!window.last) {
- // first call
- window.last = window.now;
- moveP(event, data);
- }
- }
-
-
- // Handle movement on document for handle and range drag.
- function moveP ( event, data ) {
-
- var handles = data.handles || $Handles, positions, state = false,
- proposal = ((event.calcPoint - data.start) * 100) / baseSize(),
- h = handles[0][0] !== $Handles[0][0] ? 1 : 0;
-
- // Calculate relative positions for the handles.
- positions = getPositions( proposal, data.positions, handles.length > 1);
-
- state = setHandle ( handles[0], positions[h], handles.length === 1 );
-
- if ( handles.length > 1 ) {
- state = setHandle ( handles[1], positions[h?0:1], false ) || state;
- }
-
- // Fire the 'slide' event if any handle moved.
- if ( state ) {
- fireEvents(['slide']);
- }
-
- }
-
- // Unbind move events on document, call callbacks.
- function end ( event ) {
-
- // The handle is no longer active, so remove the class.
- $('.' + Classes[15]).removeClass(Classes[15]);
-
- // Remove cursor styles and text-selection events bound to the body.
- if ( event.cursor ) {
- $('body').css('cursor', '').off( namespace );
- }
-
- // Unbind the move and end events, which are added on 'start'.
- doc.off( namespace );
-
- // Remove dragging class.
- $Target.removeClass(Classes[12]);
-
- // Fire the change and set events.
- fireEvents(['set', 'change']);
- }
-
- // Bind move events on document.
- function start ( event, data ) {
-
- // Mark the handle as 'active' so it can be styled.
- if( data.handles.length === 1 ) {
- data.handles[0].children().addClass(Classes[15]);
- }
-
- // A drag should never propagate up to the 'tap' event.
- event.stopPropagation();
-
- // Attach the move event.
- attach ( actions.move, doc, move, {
- start: event.calcPoint,
- handles: data.handles,
- positions: [
- $Locations[0],
- $Locations[$Handles.length - 1]
- ]
- });
-
- // Unbind all movement when the drag ends.
- attach ( actions.end, doc, end, null );
-
- // Text selection isn't an issue on touch devices,
- // so adding cursor styles can be skipped.
- if ( event.cursor ) {
-
- // Prevent the 'I' cursor and extend the range-drag cursor.
- $('body').css('cursor', $(event.target).css('cursor'));
-
- // Mark the target with a dragging state.
- if ( $Handles.length > 1 ) {
- $Target.addClass(Classes[12]);
- }
-
- // Prevent text selection when dragging the handles.
- $('body').on('selectstart' + namespace, false);
- }
- }
-
- // Move closest handle to tapped location.
- function tap ( event ) {
-
- var location = event.calcPoint, total = 0, to;
-
- // The tap event shouldn't propagate up and cause 'edge' to run.
- event.stopPropagation();
-
- // Add up the handle offsets.
- $.each( $Handles, function(){
- total += this.offset()[ options.style ];
- });
-
- // Find the handle closest to the tapped position.
- total = ( location < total/2 || $Handles.length === 1 ) ? 0 : 1;
-
- location -= $Base.offset()[ options.style ];
-
- // Calculate the new position.
- to = ( location * 100 ) / baseSize();
-
- if ( !options.events.snap ) {
- // Flag the slider as it is now in a transitional state.
- // Transition takes 300 ms, so re-enable the slider afterwards.
- addClassFor( $Target, Classes[14], 300 );
- }
-
- // Find the closest handle and calculate the tapped point.
- // The set handle to the new position.
- setHandle( $Handles[total], to );
-
- fireEvents(['slide', 'set', 'change']);
-
- if ( options.events.snap ) {
- start(event, { handles: [$Handles[total]] });
- }
- }
-
- // Attach events to several slider parts.
- function events ( behaviour ) {
-
- var i, drag;
-
- // Attach the standard drag event to the handles.
- if ( !behaviour.fixed ) {
-
- for ( i = 0; i < $Handles.length; i += 1 ) {
-
- // These events are only bound to the visual handle
- // element, not the 'real' origin element.
- attach ( actions.start, $Handles[i].children(), start, {
- handles: [ $Handles[i] ]
- });
- }
- }
-
- // Attach the tap event to the slider base.
- if ( behaviour.tap ) {
-
- attach ( actions.start, $Base, tap, {
- handles: $Handles
- });
- }
-
- // Make the range dragable.
- if ( behaviour.drag ){
-
- drag = $Base.find( '.' + Classes[7] ).addClass( Classes[10] );
-
- // When the range is fixed, the entire range can
- // be dragged by the handles. The handle in the first
- // origin will propagate the start event upward,
- // but it needs to be bound manually on the other.
- if ( behaviour.fixed ) {
- drag = drag.add($Base.children().not( drag ).children());
- }
-
- attach ( actions.start, drag, start, {
- handles: $Handles
- });
- }
- }
-
-
- // Test suggested values and apply margin, step.
- function setHandle ( handle, to, noLimitOption ) {
-
- var trigger = handle[0] !== $Handles[0][0] ? 1 : 0,
- lowerMargin = $Locations[0] + options.margin,
- upperMargin = $Locations[1] - options.margin,
- lowerLimit = $Locations[0] + options.limit,
- upperLimit = $Locations[1] - options.limit;
-
- // For sliders with multiple handles,
- // limit movement to the other handle.
- // Apply the margin option by adding it to the handle positions.
- if ( $Handles.length > 1 ) {
- to = trigger ? Math.max( to, lowerMargin ) : Math.min( to, upperMargin );
- }
-
- // The limit option has the opposite effect, limiting handles to a
- // maximum distance from another. Limit must be > 0, as otherwise
- // handles would be unmoveable. 'noLimitOption' is set to 'false'
- // for the .val() method, except for pass 4/4.
- if ( noLimitOption !== false && options.limit && $Handles.length > 1 ) {
- to = trigger ? Math.min ( to, lowerLimit ) : Math.max( to, upperLimit );
- }
-
- // Handle the step option.
- to = $Spectrum.getStep( to );
-
- // Limit to 0/100 for .val input, trim anything beyond 7 digits, as
- // JavaScript has some issues in its floating point implementation.
- to = limit(parseFloat(to.toFixed(7)));
-
- // Return false if handle can't move.
- if ( to === $Locations[trigger] ) {
- return false;
- }
-
- // Set the handle to the new position.
- handle.css( options.style, to + '%' );
-
- // Force proper handle stacking
- if ( handle.is(':first-child') ) {
- handle.toggleClass(Classes[17], to > 50 );
- }
-
- // Update locations.
- $Locations[trigger] = to;
-
- // Convert the value to the slider stepping/range.
- $Values[trigger] = $Spectrum.fromStepping( to );
-
- linkUpdate(triggerPos[trigger]);
-
- return true;
- }
-
- // Loop values from value method and apply them.
- function setValues ( count, values ) {
-
- var i, trigger, to;
-
- // With the limit option, we'll need another limiting pass.
- if ( options.limit ) {
- count += 1;
- }
-
- // If there are multiple handles to be set run the setting
- // mechanism twice for the first handle, to make sure it
- // can be bounced of the second one properly.
- for ( i = 0; i < count; i += 1 ) {
-
- trigger = i%2;
-
- // Get the current argument from the array.
- to = values[trigger];
-
- // Setting with null indicates an 'ignore'.
- // Inputting 'false' is invalid.
- if ( to !== null && to !== false ) {
-
- // If a formatted number was passed, attemt to decode it.
- if ( typeof to === 'number' ) {
- to = String(to);
- }
-
- to = options.format.from( to );
-
- // Request an update for all links if the value was invalid.
- // Do so too if setting the handle fails.
- if ( to === false || isNaN(to) || setHandle( $Handles[trigger], $Spectrum.toStepping( to ), i === (3 - options.dir) ) === false ) {
-
- linkUpdate(triggerPos[trigger]);
- }
- }
- }
- }
-
- // Set the slider value.
- function valueSet ( input ) {
-
- // LibLink: don't accept new values when currently emitting changes.
- if ( $Target[0].LinkIsEmitting ) {
- return this;
- }
-
- var count, values = asArray( input );
-
- // The RTL settings is implemented by reversing the front-end,
- // internal mechanisms are the same.
- if ( options.dir && options.handles > 1 ) {
- values.reverse();
- }
-
- // Animation is optional.
- // Make sure the initial values where set before using animated
- // placement. (no report, unit testing);
- if ( options.animate && $Locations[0] !== -1 ) {
- addClassFor( $Target, Classes[14], 300 );
- }
-
- // Determine how often to set the handles.
- count = $Handles.length > 1 ? 3 : 1;
-
- if ( values.length === 1 ) {
- count = 1;
- }
-
- setValues ( count, values );
-
- // Fire the 'set' event. As of noUiSlider 7,
- // this is no longer optional.
- fireEvents(['set']);
-
- return this;
- }
-
- // Get the slider value.
- function valueGet ( ) {
-
- var i, retour = [];
-
- // Get the value from all handles.
- for ( i = 0; i < options.handles; i += 1 ){
- retour[i] = options.format.to( $Values[i] );
- }
-
- return inSliderOrder( retour );
- }
-
- // Destroy the slider and unbind all events.
- function destroyTarget ( ) {
-
- // Unbind events on the slider, remove all classes and child elements.
- $(this).off(namespace)
- .removeClass(Classes.join(' '))
- .empty();
-
- delete this.LinkUpdate;
- delete this.LinkConfirm;
- delete this.LinkDefaultFormatter;
- delete this.LinkDefaultFlag;
- delete this.reappend;
- delete this.vGet;
- delete this.vSet;
- delete this.getCurrentStep;
- delete this.getInfo;
- delete this.destroy;
-
- // Return the original options from the closure.
- return originalOptions;
- }
-
- // Get the current step size for the slider.
- function getCurrentStep ( ) {
-
- // Check all locations, map them to their stepping point.
- // Get the step point, then find it in the input list.
- var retour = $.map($Locations, function( location, index ){
-
- var step = $Spectrum.getApplicableStep( location ),
- value = $Values[index],
- increment = step[2],
- decrement = (value - step[2]) >= step[1] ? step[2] : step[0];
-
- return [[decrement, increment]];
- });
-
- // Return values in the proper order.
- return inSliderOrder( retour );
- }
-
- // Get the original set of options.
- function getOriginalOptions ( ) {
- return originalOptions;
- }
-
-
-// Initialize slider
-
- // Throw an error if the slider was already initialized.
- if ( $Target.hasClass(Classes[0]) ) {
- throw new Error('Slider was already initialized.');
- }
-
- // Create the base element, initialise HTML and set classes.
- // Add handles and links.
- $Base = addSlider( options.dir, options.ort, $Target );
- $Handles = addHandles( options.handles, options.dir, $Base );
-
- // Set the connect classes.
- addConnection ( options.connect, $Target, $Handles );
-
- // Attach user events.
- events( options.events );
-
-// Methods
-
- target.vSet = valueSet;
- target.vGet = valueGet;
- target.destroy = destroyTarget;
-
- target.getCurrentStep = getCurrentStep;
- target.getOriginalOptions = getOriginalOptions;
-
- target.getInfo = function(){
- return [
- $Spectrum,
- options.style,
- options.ort
- ];
- };
-
- // Use the public value method to set the start values.
- $Target.val( options.start );
-
-}
-
-
- // Run the standard initializer
- function initialize ( originalOptions ) {
-
- // Throw error if group is empty.
- if ( !this.length ){
- throw new Error("noUiSlider: Can't initialize slider on empty selection.");
- }
-
- // Test the options once, not for every slider.
- var options = testOptions( originalOptions, this );
-
- // Loop all items, and provide a new closed-scope environment.
- return this.each(function(){
- closure(this, options, originalOptions);
- });
- }
-
- // Destroy the slider, then re-enter initialization.
- function rebuild ( options ) {
-
- return this.each(function(){
-
- // The rebuild flag can be used if the slider wasn't initialized yet.
- if ( !this.destroy ) {
- $(this).noUiSlider( options );
- return;
- }
-
- // Get the current values from the slider,
- // including the initialization options.
- var values = $(this).val(), originalOptions = this.destroy(),
-
- // Extend the previous options with the newly provided ones.
- newOptions = $.extend( {}, originalOptions, options );
-
- // Run the standard initializer.
- $(this).noUiSlider( newOptions );
-
- // Place Link elements back.
- this.reappend();
-
- // If the start option hasn't changed,
- // reset the previous values.
- if ( originalOptions.start === newOptions.start ) {
- $(this).val(values);
- }
- });
- }
-
- // Access the internal getting and setting methods based on argument count.
- function value ( ) {
- return this[0][ !arguments.length ? 'vGet' : 'vSet' ].apply(this[0], arguments);
- }
-
- // Override the .val() method. Test every element. Is it a slider? Go to
- // the slider value handling. No? Use the standard method.
- // Note how $.fn.val expects 'this' to be an instance of $. For convenience,
- // the above 'value' function does too.
- $.fn.val = function ( ) {
-
- // this === instanceof $
-
- function valMethod( a ){
- return a.hasClass(Classes[0]) ? value : $val;
- }
-
- var args = arguments,
- first = $(this[0]);
-
- if ( !arguments.length ) {
- return valMethod(first).call(first);
- }
-
- // Return the set so it remains chainable
- return this.each(function(){
- valMethod($(this)).apply($(this), args);
- });
- };
-
-// Extend jQuery/Zepto with the noUiSlider method.
- $.fn.noUiSlider = function ( options, rebuildFlag ) {
-
- switch ( options ) {
- case 'step': return this[0].getCurrentStep();
- case 'options': return this[0].getOriginalOptions();
- }
-
- return ( rebuildFlag ? rebuild : initialize ).call(this, options);
- };
-
- function getGroup ( $Spectrum, mode, values, stepped ) {
-
- // Use the range.
- if ( mode === 'range' || mode === 'steps' ) {
- return $Spectrum.xVal;
- }
-
- if ( mode === 'count' ) {
-
- // Divide 0 - 100 in 'count' parts.
- var spread = ( 100 / (values-1) ), v, i = 0;
- values = [];
-
- // List these parts and have them handled as 'positions'.
- while ((v=i++*spread) <= 100 ) {
- values.push(v);
- }
-
- mode = 'positions';
- }
-
- if ( mode === 'positions' ) {
-
- // Map all percentages to on-range values.
- return $.map(values, function( value ){
- return $Spectrum.fromStepping( stepped ? $Spectrum.getStep( value ) : value );
- });
- }
-
- if ( mode === 'values' ) {
-
- // If the value must be stepped, it needs to be converted to a percentage first.
- if ( stepped ) {
-
- return $.map(values, function( value ){
-
- // Convert to percentage, apply step, return to value.
- return $Spectrum.fromStepping( $Spectrum.getStep( $Spectrum.toStepping( value ) ) );
- });
-
- }
-
- // Otherwise, we can simply use the values.
- return values;
- }
- }
-
- function generateSpread ( $Spectrum, density, mode, group ) {
-
- var originalSpectrumDirection = $Spectrum.direction,
- indexes = {},
- firstInRange = $Spectrum.xVal[0],
- lastInRange = $Spectrum.xVal[$Spectrum.xVal.length-1],
- ignoreFirst = false,
- ignoreLast = false,
- prevPct = 0;
-
- // This function loops the spectrum in an ltr linear fashion,
- // while the toStepping method is direction aware. Trick it into
- // believing it is ltr.
- $Spectrum.direction = 0;
-
- // Create a copy of the group, sort it and filter away all duplicates.
- group = unique(group.slice().sort(function(a, b){ return a - b; }));
-
- // Make sure the range starts with the first element.
- if ( group[0] !== firstInRange ) {
- group.unshift(firstInRange);
- ignoreFirst = true;
- }
-
- // Likewise for the last one.
- if ( group[group.length - 1] !== lastInRange ) {
- group.push(lastInRange);
- ignoreLast = true;
- }
-
- $.each(group, function ( index ) {
-
- // Get the current step and the lower + upper positions.
- var step, i, q,
- low = group[index],
- high = group[index+1],
- newPct, pctDifference, pctPos, type,
- steps, realSteps, stepsize;
-
- // When using 'steps' mode, use the provided steps.
- // Otherwise, we'll step on to the next subrange.
- if ( mode === 'steps' ) {
- step = $Spectrum.xNumSteps[ index ];
- }
-
- // Default to a 'full' step.
- if ( !step ) {
- step = high-low;
- }
-
- // Low can be 0, so test for false. If high is undefined,
- // we are at the last subrange. Index 0 is already handled.
- if ( low === false || high === undefined ) {
- return;
- }
-
- // Find all steps in the subrange.
- for ( i = low; i <= high; i += step ) {
-
- // Get the percentage value for the current step,
- // calculate the size for the subrange.
- newPct = $Spectrum.toStepping( i );
- pctDifference = newPct - prevPct;
-
- steps = pctDifference / density;
- realSteps = Math.round(steps);
-
- // This ratio represents the ammount of percentage-space a point indicates.
- // For a density 1 the points/percentage = 1. For density 2, that percentage needs to be re-devided.
- // Round the percentage offset to an even number, then divide by two
- // to spread the offset on both sides of the range.
- stepsize = pctDifference/realSteps;
-
- // Divide all points evenly, adding the correct number to this subrange.
- // Run up to <= so that 100% gets a point, event if ignoreLast is set.
- for ( q = 1; q <= realSteps; q += 1 ) {
-
- // The ratio between the rounded value and the actual size might be ~1% off.
- // Correct the percentage offset by the number of points
- // per subrange. density = 1 will result in 100 points on the
- // full range, 2 for 50, 4 for 25, etc.
- pctPos = prevPct + ( q * stepsize );
- indexes[pctPos.toFixed(5)] = ['x', 0];
- }
-
- // Determine the point type.
- type = ($.inArray(i, group) > -1) ? 1 : ( mode === 'steps' ? 2 : 0 );
-
- // Enforce the 'ignoreFirst' option by overwriting the type for 0.
- if ( !index && ignoreFirst && !low ) {
- type = 0;
- }
-
- if ( !(i === high && ignoreLast)) {
- // Mark the 'type' of this point. 0 = plain, 1 = real value, 2 = step value.
- indexes[newPct.toFixed(5)] = [i, type];
- }
-
- // Update the percentage count.
- prevPct = newPct;
- }
- });
-
- // Reset the spectrum.
- $Spectrum.direction = originalSpectrumDirection;
-
- return indexes;
- }
-
- function addMarking ( CSSstyle, orientation, direction, spread, filterFunc, formatter ) {
-
- var style = ['horizontal', 'vertical'][orientation],
- element = $('');
-
- element.addClass('noUi-pips noUi-pips-'+style);
-
- function getSize( type, value ){
- return [ '-normal', '-large', '-sub' ][(type&&filterFunc) ? filterFunc(value, type) : type];
- }
- function getTags( offset, source, values ) {
- return 'class="' + source + ' ' +
- source + '-' + style + ' ' +
- source + getSize(values[1], values[0]) +
- '" style="' + CSSstyle + ': ' + offset + '%"';
- }
- function addSpread ( offset, values ){
-
- if ( direction ) {
- offset = 100 - offset;
- }
-
- // Add a marker for every point
- element.append('');
-
- // Values are only appended for points marked '1' or '2'.
- if ( values[1] ) {
- element.append('' + formatter.to(values[0]) + '
');
- }
- }
-
- // Append all points.
- $.each(spread, addSpread);
-
- return element;
- }
-
- $.fn.noUiSlider_pips = function ( grid ) {
-
- var mode = grid.mode,
- density = grid.density || 1,
- filter = grid.filter || false,
- values = grid.values || false,
- format = grid.format || {
- to: Math.round
- },
- stepped = grid.stepped || false;
-
- return this.each(function(){
-
- var info = this.getInfo(),
- group = getGroup( info[0], mode, values, stepped ),
- spread = generateSpread( info[0], density, mode, group );
-
- return $(this).append(addMarking(
- info[1],
- info[2],
- info[0].direction,
- spread,
- filter,
- format
- ));
- });
- };
-
-}( window.jQuery || window.Zepto ));
diff --git a/browser/js/jquery/jquery.ui.touch-punch.min.js b/browser/js/jquery/jquery.ui.touch-punch.min.js
deleted file mode 100644
index 31272ce6..00000000
--- a/browser/js/jquery/jquery.ui.touch-punch.min.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/*!
- * jQuery UI Touch Punch 0.2.3
- *
- * Copyright 2011–2014, Dave Furfero
- * Dual licensed under the MIT or GPL Version 2 licenses.
- *
- * Depends:
- * jquery.ui.widget.js
- * jquery.ui.mouse.js
- */
-!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
\ No newline at end of file
diff --git a/sessions/demo.js b/sessions/demo.js
index c336f9ac..0f5404b9 100644
--- a/sessions/demo.js
+++ b/sessions/demo.js
@@ -18,10 +18,23 @@ TABS = {
testingshits: {
widgets:{
+ switchtest: {
+ type:'switch',
+ target:'localhost:6666',
+ path:'/osc/path/',
+ color:'#555522',
+ values:[0,1,2]
+ },
stacktest: {
type:'stack',
widgets:{
-
+ switchtest: {
+ type:'switch',
+ target:'localhost:6666',
+ path:'/osc/path/',
+ color:'#555522',
+ values:[0,1,2]
+ },
Drums: {
title:'BassesXXX',
range:'db',
@@ -41,7 +54,7 @@ TABS = {
path:'/strip/Guitars/Gain/Gain%20(dB)/unscaled'
},
button1: {
- type:'button',
+ type:'toggle',
target:'localhost:6666',
path:'/osc/path/',
color:'#555522'
@@ -57,7 +70,7 @@ TABS = {
path:'/pad'
},
button1: {
- type:'button',
+ type:'toggle',
target:'localhost:6666',
path:'/osc/path/',
color:'#555522'