User:Arlen22/jquery.js

//My jQuery plugins. //http://jscompress.com/ /* * jquery.mousewheel.js * Version: 3.0.6 * Requires: 1.2.2+ */ (function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=true,o=0,u=0;t=e.event.fix(n);t.type="mousewheel";if(n.wheelDelta){i=n.wheelDelta/120}if(n.detail){i=-n.detail/3}u=i;if(n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS){u=0;o=-1*i}if(n.wheelDeltaY!==undefined){u=n.wheelDeltaY/120}if(n.wheelDeltaX!==undefined){o=-1*n.wheelDeltaX/120}r.unshift(t,i,o,u);return(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks){for(var n=t.length;n;){e.event.fixHooks[t[--n]]=e.event.mouseHooks}}e.event.special.mousewheel={setup:function{if(this.addEventListener){for(var e=t.length;e;){this.addEventListener(t[--e],r,false)}}else{this.onmousewheel=r}},teardown:function{if(this.removeEventListener){for(var e=t.length;e;){this.removeEventListener(t[--e],r,false)}}else{this.onmousewheel=null}}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})(jQuery); /* * version 1.5.0 * http://welcome.totheinter.net/columnizer-jquery-plugin/ * created by: Adam Wulf @adamwulf, adam.wulf@gmail.com */ (function(e){e.fn.columnize=function(t){var n={width:400,columns:false,buildOnce:false,overflow:false,doneFunc:function{},target:false,ignoreImageLoading:true,columnFloat:"left",lastNeverTallest:false,accuracy:false};var t=e.extend(n,t);if(typeof t.width=="string"){t.width=parseInt(t.width);if(isNaN(t.width)){t.width=n.width}}return this.each(function{function f(n,r,i,s){while(i.heightl){f=f.substring(f.indexOf(" ",l))}else{f=""}}if(i.height>=s&&h!=null){n[0].removeChild(h);f=h.nodeValue+f}if(f.length){a[0].nodeValue=f}else{return false}}if(r.children.length){r.prepend(a)}else{r.append(a)}return a[0].nodeType==3}function l(e,t,n,r){if(t.children.length){$cloneMe=t.children(":first");$clone=$cloneMe.clone(true);if($clone.prop("nodeType")==1&&!$clone.hasClass("dontend")){e.append($clone);if($clone.is("img")&&n.height<r+20){$cloneMe.remove}else if(!$cloneMe.hasClass("dontsplit")&&n.height "));$col=n.children.eq(n.children.length-1);$destroyable=i.clone(true);if(t.overflow){targetHeight=t.overflow.height;f($col,$destroyable,$col,targetHeight);if(!$destroyable.contents.find(":first-child").hasClass("dontend")){l($col,$destroyable,$col,targetHeight)}while(h($col.children(":last").length&&$col.children(":last").get(0))){var r=$col.children(":last");r.remove;$destroyable.prepend(r)}var s="";var o=document.createElement("DIV");while($destroyable[0].childNodes.length>0){var u=$destroyable[0].childNodes[0];for(var a=0;a<u.attributes.length;a++){if(u.attributes[a].nodeName.indexOf("jQuery")==0){u.removeAttribute(u.attributes[a].nodeName)}}o.innerHTML="";o.appendChild($destroyable[0].childNodes[0]);s+=o.innerHTML}var c=e(t.overflow.id)[0];c.innerHTML=s}else{$col.append($destroyable)}n.data("columnizing",false);if(t.overflow){t.overflow.doneFunc}}function h(t){if(t.nodeType!=1)return false;if(e(t).hasClass("dontend"))return true;if(t.childNodes.length==0)return false;return h(t.childNodes[t.childNodes.length-1])}function p{if(s==n.width)return;s=n.width;var o=Math.round(n.width/t.width);if(t.columns)o=t.columns;if(o<=1){return c}if(n.data("columnizing"))return;n.data("columnized",true);n.data("columnizing",true);n.empty;n.append(e(" "));E=n.children(":last");E.append(i.clone);r=E.height;n.empty;var a=r/o;var p=true;var d=3;var v=false;if(t.overflow){d=1;a=t.overflow.height}else if(t.height&&t.width){d=1;a=t.height;v=true}for(var m=0;m "))}var b=0;while(b "))}var E=n.children.eq(b);f(E,g,E,a);if(!g.contents.find(":first-child").hasClass("dontend")){l(E,g,E,a)}else{}while(h(E.children(":last").length&&E.children(":last").get(0))){var S=E.children(":last");S.remove;g.prepend(S)}b++}if(t.overflow&&!v){var x=false;var T=document.all&&navigator.appVersion.indexOf("MSIE 7.")!=-1;if(x||T){var N="";var C=document.createElement("DIV");while(g[0].childNodes.length>0){var k=g[0].childNodes[0];for(var b=0;b<k.attributes.length;b++){if(k.attributes[b].nodeName.indexOf("jQuery")==0){k.removeAttribute(k.attributes[b].nodeName)}}C.innerHTML="";C.appendChild(g[0].childNodes[0]);N+=C.innerHTML}var L=e(t.overflow.id)[0];L.innerHTML=N}else{e(t.overflow.id).empty.append(g.contents.clone(true))}}else if(!v){E=n.children.eq(n.children.length-1);while(g.contents.length)E.append(g.contents(":first"));var A=E.height;var O=A-a;var M=0;var _=1e7;var D=0;var P=false;n.children.each(function(e){return function(t){var n=e.children.eq(t).height;P=false;M+=n;if(n>D){D=n;P=true}if(n<_)_=n}}(n));var H=M/o;if(t.lastNeverTallest&&P){u+=30;if(u<100){a=a+30;if(m==d-1)d++}else{debugger;m=d}}else if(D-_>30){a=H+30}else if(Math.abs(H-a)>20){a=H}else{m=d}}else{n.children.each(function(e){E=n.children.eq(e);E.width(t.width+"px");if(e==0){E.addClass("first")}else if(e==n.children.length-1){E.addClass("last")}else{E.removeClass("first");E.removeClass("last")}});n.width(n.children.length*t.width+"px")}n.append(e(""))}n.find(".column").find(":first.removeiffirst").remove;n.find(".column").find(":last.removeiflast").remove;n.data("columnizing",false);if(t.overflow){t.overflow.doneFunc}t.doneFunc}var n=t.target?e(t.target):e(this);var r=e(this).height;var i=e(" ");var s=0;var o=false;var u=0;i.append(e(this).contents.clone(true));if(!t.ignoreImageLoading&&!t.target){if(!n.data("imageLoaded")){n.data("imageLoaded",true);if(e(this).find("img").length>0){var a=function(e,n){return function{if(!e.data("firstImageLoaded")){e.data("firstImageLoaded","true");e.empty.append(n.children.clone(true));e.columnize(t)}}}(e(this),i);e(this).find("img").one("load",a);e(this).find("img").one("abort",a);return}}}n.empty;p;if(!t.buildOnce){e(window).resize(function{if(!t.buildOnce&&e.browser.msie){if(n.data("timeout")){clearTimeout(n.data("timeout"))}n.data("timeout",setTimeout(p,200))}else if(!t.buildOnce){p}else{}})}})}})(jQuery);