]> ruin.nu Git - ndwebbie.git/blob - root/static/ui/ui.core.min.js
Allow users to store their birthday
[ndwebbie.git] / root / static / ui / ui.core.min.js
1 (function(D){var C=D.fn.remove;D.fn.remove=function(){D("*",this).add(this).triggerHandler("remove");return C.apply(this,arguments)};function B(E){function G(H){var I=H.style;return(I.display!="none"&&I.visibility!="hidden")}var F=G(E);(F&&D.each(D.dir(E,"parentNode"),function(){return(F=G(this))}));return F}D.extend(D.expr[":"],{data:function(F,G,E){return D.data(F,E[3])},tabbable:function(F,G,E){var H=F.nodeName.toLowerCase();return(F.tabIndex>=0&&(("a"==H&&F.href)||(/input|select|textarea|button/.test(H)&&"hidden"!=F.type&&!F.disabled))&&B(F))}});D.keyCode={BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38};function A(H,I,J,G){function F(L){var K=D[H][I][L]||[];return(typeof K=="string"?K.split(/,?\s+/):K)}var E=F("getter");if(G.length==1&&typeof G[0]=="string"){E=E.concat(F("getterSetter"))}return(D.inArray(J,E)!=-1)}D.widget=function(F,E){var G=F.split(".")[0];F=F.split(".")[1];D.fn[F]=function(K){var I=(typeof K=="string"),J=Array.prototype.slice.call(arguments,1);if(I&&K.substring(0,1)=="_"){return this}if(I&&A(G,F,K,J)){var H=D.data(this[0],F);return(H?H[K].apply(H,J):undefined)}return this.each(function(){var L=D.data(this,F);(!L&&!I&&D.data(this,F,new D[G][F](this,K)));(L&&I&&D.isFunction(L[K])&&L[K].apply(L,J))})};D[G][F]=function(J,I){var H=this;this.widgetName=F;this.widgetEventPrefix=D[G][F].eventPrefix||F;this.widgetBaseClass=G+"-"+F;this.options=D.extend({},D.widget.defaults,D[G][F].defaults,D.metadata&&D.metadata.get(J)[F],I);this.element=D(J).bind("setData."+F,function(M,K,L){return H._setData(K,L)}).bind("getData."+F,function(L,K){return H._getData(K)}).bind("remove",function(){return H.destroy()});this._init()};D[G][F].prototype=D.extend({},D.widget.prototype,E);D[G][F].getterSetter="option"};D.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName)},option:function(G,H){var F=G,E=this;if(typeof G=="string"){if(H===undefined){return this._getData(G)}F={};F[G]=H}D.each(F,function(I,J){E._setData(I,J)})},_getData:function(E){return this.options[E]},_setData:function(E,F){this.options[E]=F;if(E=="disabled"){this.element[F?"addClass":"removeClass"](this.widgetBaseClass+"-disabled")}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(F,H,G){var E=(F==this.widgetEventPrefix?F:this.widgetEventPrefix+F);H=H||D.event.fix({type:E,target:this.element[0]});return this.element.triggerHandler(E,[H,G],this.options[F])}};D.widget.defaults={disabled:false};D.ui={plugin:{add:function(F,G,I){var H=D.ui[F].prototype;for(var E in I){H.plugins[E]=H.plugins[E]||[];H.plugins[E].push([G,I[E]])}},call:function(E,G,F){var I=E.plugins[G];if(!I){return }for(var H=0;H<I.length;H++){if(E.options[I[H][0]]){I[H][1].apply(E.element,F)}}}},cssCache:{},css:function(E){if(D.ui.cssCache[E]){return D.ui.cssCache[E]}var F=D('<div class="ui-gen">').addClass(E).css({position:"absolute",top:"-5000px",left:"-5000px",display:"block"}).appendTo("body");D.ui.cssCache[E]=!!((!(/auto|default/).test(F.css("cursor"))||(/^[1-9]/).test(F.css("height"))||(/^[1-9]/).test(F.css("width"))||!(/none/).test(F.css("backgroundImage"))||!(/transparent|rgba\(0, 0, 0, 0\)/).test(F.css("backgroundColor"))));try{D("body").get(0).removeChild(F.get(0))}catch(G){}return D.ui.cssCache[E]},disableSelection:function(E){return D(E).attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},enableSelection:function(E){return D(E).attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},hasScroll:function(H,F){if(D(H).css("overflow")=="hidden"){return false}var E=(F&&F=="left")?"scrollLeft":"scrollTop",G=false;if(H[E]>0){return true}H[E]=1;G=(H[E]>0);H[E]=0;return G}};D.ui.mouse={_mouseInit:function(){var E=this;this.element.bind("mousedown."+this.widgetName,function(F){return E._mouseDown(F)});if(D.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(D.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(G){(this._mouseStarted&&this._mouseUp(G));this._mouseDownEvent=G;var F=this,H=(G.which==1),E=(typeof this.options.cancel=="string"?D(G.target).parents().add(G.target).filter(this.options.cancel).length:false);if(!H||E||!this._mouseCapture(G)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){F.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(G)&&this._mouseDelayMet(G)){this._mouseStarted=(this._mouseStart(G)!==false);if(!this._mouseStarted){G.preventDefault();return true}}this._mouseMoveDelegate=function(I){return F._mouseMove(I)};this._mouseUpDelegate=function(I){return F._mouseUp(I)};D(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);return false},_mouseMove:function(E){if(D.browser.msie&&!E.button){return this._mouseUp(E)}if(this._mouseStarted){this._mouseDrag(E);return false}if(this._mouseDistanceMet(E)&&this._mouseDelayMet(E)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,E)!==false);(this._mouseStarted?this._mouseDrag(E):this._mouseUp(E))}return !this._mouseStarted},_mouseUp:function(E){D(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._mouseStop(E)}return false},_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(E){return this.mouseDelayMet},_mouseStart:function(E){},_mouseDrag:function(E){},_mouseStop:function(E){},_mouseCapture:function(E){return true}};D.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery)