diff options
| author | tekimaki <will@tekimaki.com> | 2010-11-29 17:24:09 -0500 |
|---|---|---|
| committer | tekimaki <will@tekimaki.com> | 2010-11-29 17:24:09 -0500 |
| commit | 34eaa9639374aef39478de8d22756294971bb454 (patch) | |
| tree | 34e5b9a573ff58d4088d77383f1a60f665d74a9c | |
| parent | d2442daac5fa3b67566ec371bcfaeba2bb477838 (diff) | |
| parent | 5b51803d3cfe500938584e5fd6a6468bc96bab5b (diff) | |
| download | util-34eaa9639374aef39478de8d22756294971bb454.tar.gz util-34eaa9639374aef39478de8d22756294971bb454.tar.bz2 util-34eaa9639374aef39478de8d22756294971bb454.zip | |
Merge branch 'master' of git.cloudred.com:bw_pkg_util
20 files changed, 165 insertions, 6 deletions
diff --git a/javascript/JQuery.BitMultiForm.js b/javascript/JQuery.BitMultiForm.js index 921543c..d7e3787 100644 --- a/javascript/JQuery.BitMultiForm.js +++ b/javascript/JQuery.BitMultiForm.js @@ -4,21 +4,25 @@ // Dependency: Prototype
var $jq = jQuery.noConflict();
BitMultiForm = {
- 'addForm':function (template,target) {
+ 'addForm':function (template,target,max) {
//Set Variables
var index,cloneNode,curr_units,inputs;
-
//Get all the form units from the master div that holds all the unique instances of the cloned input blocks
curr_units = $jq('#'+target).find('.multiform_unit');
//Count the number of instances of the form and increase the number by 1 to grab our new index
+ button = template.replace("_temp",'_add_button');
if( typeof( BitMultiForm.seqs[target] ) != 'undefined' ){
BitMultiForm.seqs[target]++; // javascript is stupid
+ BitMultiForm.total[button]++;
index = BitMultiForm.seqs[target];
}else{
index = BitMultiForm.seqs[target] = curr_units.length;
+ BitMultiForm.total[button] = curr_units.length;
+ }
+ if (typeof(max) != 'undefined' && BitMultiForm.total[button] >= max - 1) {
+ BitBase.setElementDisplay(button, 'none', false);
}
-
//Clone the template node and set the attributes
cloneElm = $jq( BitBase.$(template).cloneNode(true) );
var id1 = cloneElm.attr('id',cloneElm.attr('id').replace('temp',index));
@@ -50,9 +54,15 @@ BitMultiForm = { }
},
'removeForm':function (elmId) {
- //Remove the form from the master div
+ //Remove the form from the master div and make sure add shows
+ button = elmId.replace(/_[0-9]+/, '_add_button');
+ if( typeof( BitMultiForm.total[button] ) != 'undefined' ){
+ BitMultiForm.total[button]--;
+ }
+ BitBase.setElementDisplay(button, 'block', false);
BitBase.$(elmId).parentNode.removeChild( BitBase.$(elmId) );
},
- 'seqs':{}
+ 'seqs':{},
+ 'total':{}
};
diff --git a/javascript/bitweaver.js b/javascript/bitweaver.js index 9aae0af..259f6f8 100644 --- a/javascript/bitweaver.js +++ b/javascript/bitweaver.js @@ -7,6 +7,70 @@ // the beginning of the clean up of bitweaver core js - use name spaces // if you are adding new features to this file add them to the BitBase object. BitBase = { + // windowCenter and windowSize hacked based on http://www.demtron.com/blog/post/2009/01/14/Centering-a-DIV-Window-with-Cross-Browser-JavaScript.aspx + "windowSize" : function() + { + var w = 0; + var h = 0; + //IE + if(!window.innerWidth) + { + //strict mode + if(!(document.documentElement.clientWidth == 0)) + { + w = document.documentElement.clientWidth; + h = document.documentElement.clientHeight; + } + //quirks mode + else + { + w = document.body.clientWidth; + h = document.body.clientHeight; + } + } + //w3c + else + { + w = window.innerWidth; + h = window.innerHeight; + } + return {width:w,height:h}; + }, + + "windowCenter" : function(hWnd) + { + var _x = 0; + var _y = 0; + var offsetX = 0; + var offsetY = 0; + //IE + if(!window.pageYOffset) + { + //strict mode + if(!(document.documentElement.scrollTop == 0)) + { + offsetY = document.documentElement.scrollTop; + offsetX = document.documentElement.scrollLeft; + } + //quirks mode + else + { + offsetY = document.body.scrollTop; + offsetX = document.body.scrollLeft; + } + } + //w3c + else + { + offsetX = window.pageXOffset; + offsetY = window.pageYOffset; + } + _sz = BitBase.windowSize(); + _x = ((_sz.width-hWnd.width)/2)+offsetX; + _y = ((_sz.height-hWnd.height)/2)+offsetY; + return{x:_x,y:_y}; + }, + // constants // DATE - set in init() // newWindow used in closeWin() @@ -216,12 +280,27 @@ BitBase = { // desc: convenience "showSpinner": function() { - BitBase.setElementDisplay( 'spinner','block' ); + // Center the spinner + div = document.getElementById( 'spinner' ); + w = div.style.width.replace(/[a-z]/gi, ''); + h = div.style.height.replace(/[a-z]/gi,''); + center = BitBase.windowCenter({width: w, height: h}); + div.style.top = center.y + "px"; + div.style.left = center.x + "px" + // Now resize the overlay + div = document.getElementById( 'spinner_overlay' ); + dim = BitBase.windowSize(); + div.style.width = dim.width + "px"; + div.style.height = dim.height + "px"; + // And show them both. + BitBase.setElementDisplay( 'spinner_overlay', 'block' ); + BitBase.setElementDisplay( 'spinner', 'block'); }, // desc: convenience "hideSpinner": function() { BitBase.setElementDisplay( 'spinner','none' ); + BitBase.setElementDisplay( 'spinner_overlay','none' ); }, // desc: No Idea - used by insertAt diff --git a/javascript/colorbox/colorbox.css b/javascript/colorbox/colorbox.css new file mode 100644 index 0000000..17f84b9 --- /dev/null +++ b/javascript/colorbox/colorbox.css @@ -0,0 +1,62 @@ +/* + ColorBox Core Style + The following rules are the styles that are consistant between themes. + Avoid changing this area to maintain compatability with future versions of ColorBox. +*/ +#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;} +#cboxOverlay{position:fixed; width:100%; height:100%;} +#cboxMiddleLeft, #cboxBottomLeft{clear:left;} +#cboxContent{position:relative; overflow:hidden;} +#cboxLoadedContent{overflow:auto;} +#cboxLoadedContent iframe{display:block; width:100%; height:100%; border:0;} +#cboxTitle{margin:0;} +#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%;} +#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;} + +/* + Example user style + The following rules are ordered and tabbed in a way that represents the + order/nesting of the generated HTML, so that the structure easier to understand. +*/ +#cboxOverlay{background:url(images/overlay.png) 0 0 repeat;} +#colorbox{} + #cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) -100px 0 no-repeat;} + #cboxTopRight{width:21px; height:21px; background:url(images/controls.png) -129px 0 no-repeat;} + #cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) -100px -29px no-repeat;} + #cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) -129px -29px no-repeat;} + #cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;} + #cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;} + #cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;} + #cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;} + #cboxContent{background:#fff;} + #cboxLoadedContent{margin-bottom:28px;} + #cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;} + #cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;} + #cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;} + #cboxPrevious{position:absolute; bottom:0; left:0px; background:url(images/controls.png) -75px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} + #cboxPrevious.hover{background-position:-75px -25px;} + #cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) -50px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} + #cboxNext.hover{background-position:-50px -25px;} + #cboxLoadingOverlay{background:url(images/loading_background.png) center center no-repeat;} + #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;} + #cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) -25px 0px no-repeat; width:25px; height:25px; text-indent:-9999px;} + #cboxClose.hover{background-position:-25px -25px;} + +/* + The following fixes png-transparency for IE6. + It is also necessary for png-transparency in IE7 & IE8 to avoid 'black halos' with the fade transition + + Since this method does not support CSS background-positioning, it is incompatible with CSS sprites. + Colorbox preloads navigation hover classes to account for this. + + !! Important Note: AlphaImageLoader src paths are relative to the HTML document, + while regular CSS background images are relative to the CSS document. +*/ +.cboxIE #cboxTopLeft{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderTopLeft.png, sizingMethod='scale');} +.cboxIE #cboxTopCenter{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderTopCenter.png, sizingMethod='scale');} +.cboxIE #cboxTopRight{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderTopRight.png, sizingMethod='scale');} +.cboxIE #cboxBottomLeft{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderBottomLeft.png, sizingMethod='scale');} +.cboxIE #cboxBottomCenter{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderBottomCenter.png, sizingMethod='scale');} +.cboxIE #cboxBottomRight{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderBottomRight.png, sizingMethod='scale');} +.cboxIE #cboxMiddleLeft{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderMiddleLeft.png, sizingMethod='scale');} +.cboxIE #cboxMiddleRight{background:transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=images/internet_explorer/borderMiddleRight.png, sizingMethod='scale');} diff --git a/javascript/colorbox/images/Thumbs.db b/javascript/colorbox/images/Thumbs.db Binary files differnew file mode 100644 index 0000000..4dbc211 --- /dev/null +++ b/javascript/colorbox/images/Thumbs.db diff --git a/javascript/colorbox/images/border.png b/javascript/colorbox/images/border.png Binary files differnew file mode 100644 index 0000000..f463a10 --- /dev/null +++ b/javascript/colorbox/images/border.png diff --git a/javascript/colorbox/images/controls.png b/javascript/colorbox/images/controls.png Binary files differnew file mode 100644 index 0000000..9257176 --- /dev/null +++ b/javascript/colorbox/images/controls.png diff --git a/javascript/colorbox/images/internet_explorer/Thumbs.db b/javascript/colorbox/images/internet_explorer/Thumbs.db Binary files differnew file mode 100644 index 0000000..cf86939 --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/Thumbs.db diff --git a/javascript/colorbox/images/internet_explorer/borderBottomCenter.png b/javascript/colorbox/images/internet_explorer/borderBottomCenter.png Binary files differnew file mode 100644 index 0000000..0d4475e --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderBottomCenter.png diff --git a/javascript/colorbox/images/internet_explorer/borderBottomLeft.png b/javascript/colorbox/images/internet_explorer/borderBottomLeft.png Binary files differnew file mode 100644 index 0000000..2775eba --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderBottomLeft.png diff --git a/javascript/colorbox/images/internet_explorer/borderBottomRight.png b/javascript/colorbox/images/internet_explorer/borderBottomRight.png Binary files differnew file mode 100644 index 0000000..f7f5137 --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderBottomRight.png diff --git a/javascript/colorbox/images/internet_explorer/borderMiddleLeft.png b/javascript/colorbox/images/internet_explorer/borderMiddleLeft.png Binary files differnew file mode 100644 index 0000000..a2d63d1 --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderMiddleLeft.png diff --git a/javascript/colorbox/images/internet_explorer/borderMiddleRight.png b/javascript/colorbox/images/internet_explorer/borderMiddleRight.png Binary files differnew file mode 100644 index 0000000..fd7c3e8 --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderMiddleRight.png diff --git a/javascript/colorbox/images/internet_explorer/borderTopCenter.png b/javascript/colorbox/images/internet_explorer/borderTopCenter.png Binary files differnew file mode 100644 index 0000000..2937a9c --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderTopCenter.png diff --git a/javascript/colorbox/images/internet_explorer/borderTopLeft.png b/javascript/colorbox/images/internet_explorer/borderTopLeft.png Binary files differnew file mode 100644 index 0000000..f9d458b --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderTopLeft.png diff --git a/javascript/colorbox/images/internet_explorer/borderTopRight.png b/javascript/colorbox/images/internet_explorer/borderTopRight.png Binary files differnew file mode 100644 index 0000000..74b8583 --- /dev/null +++ b/javascript/colorbox/images/internet_explorer/borderTopRight.png diff --git a/javascript/colorbox/images/loading.gif b/javascript/colorbox/images/loading.gif Binary files differnew file mode 100644 index 0000000..b4695d8 --- /dev/null +++ b/javascript/colorbox/images/loading.gif diff --git a/javascript/colorbox/images/loading_background.png b/javascript/colorbox/images/loading_background.png Binary files differnew file mode 100644 index 0000000..6ae83e6 --- /dev/null +++ b/javascript/colorbox/images/loading_background.png diff --git a/javascript/colorbox/images/overlay.png b/javascript/colorbox/images/overlay.png Binary files differnew file mode 100644 index 0000000..53ea98f --- /dev/null +++ b/javascript/colorbox/images/overlay.png diff --git a/javascript/colorbox/jquery.colorbox.js b/javascript/colorbox/jquery.colorbox.js new file mode 100644 index 0000000..fbb0d25 --- /dev/null +++ b/javascript/colorbox/jquery.colorbox.js @@ -0,0 +1,4 @@ +// ColorBox v1.3.10 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
+// Copyright (c) 2010 Jack Moore - jack@colorpowered.com
+// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+(function(c,lb){var v="none",N="LoadedContent",b=false,x="resize.",o="y",r="auto",f=true,u="click",O="nofollow",q="on",m="x";function e(a,b){a=a?' id="'+j+a+'"':"";b=b?' style="'+b+'"':"";return c("<div"+a+b+"/>")}function p(a,b){b=b===m?n.width():n.height();return typeof a==="string"?Math.round(a.match(/%/)?b/100*parseInt(a,10):parseInt(a,10)):a}function U(b,d){b=c.isFunction(b)?b.call(d):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function eb(a){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!==q)a[b]=a[b].call(l);a.rel=a.rel||l.rel||O;a.href=a.href||c(l).attr("href");a.title=a.title||l.title;return a}function y(b,a){a&&a.call(l);c.event.trigger(b)}function mb(){var c,b=j+"Slideshow_",e,f;if(a.slideshow&&i[1]){e=function(){z.text(a.slideshowStop).bind(V,function(){c=setTimeout(d.next,a.slideshowSpeed)}).bind(W,function(){clearTimeout(c)}).one(u,function(){f()});h.removeClass(b+"off").addClass(b+q)};f=function(){clearTimeout(c);z.text(a.slideshowStart).unbind(V+" "+W).one(u,function(){e();c=setTimeout(d.next,a.slideshowSpeed)});h.removeClass(b+q).addClass(b+"off")};z.bind(fb,function(){z.unbind();clearTimeout(c);h.removeClass(b+"off "+b+q)});a.slideshowAuto?e():f()}}function gb(b){if(!P){l=b;a=eb(c.extend({},c.data(l,s)));i=c(l);g=0;if(a.rel!==O){i=c("."+I).filter(function(){return (c.data(this,s).rel||this.rel)===a.rel});g=i.index(l);if(g===-1){i=i.add(l);g=i.length-1}}if(!w){w=H=f;h.show();X=l;try{X.blur()}catch(e){}A.css({opacity:+a.opacity,cursor:a.overlayClose?"pointer":r}).show();a.w=p(a.initialWidth,m);a.h=p(a.initialHeight,o);d.position(0);Y&&n.bind(x+Q+" scroll."+Q,function(){A.css({width:n.width(),height:n.height(),top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll."+Q);y(hb,a.onOpen);Z.add(J).add(K).add(z).add(ab).hide();bb.html(a.close).show()}d.load(f)}}var ib={transition:"elastic",speed:300,width:b,initialWidth:"600",innerWidth:b,maxWidth:b,height:b,initialHeight:"450",innerHeight:b,maxHeight:b,scalePhotos:f,scrolling:f,inline:b,html:b,iframe:b,photo:b,href:b,title:b,rel:b,opacity:.9,preloading:f,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:b,loop:f,slideshow:b,slideshowAuto:f,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:b,onLoad:b,onComplete:b,onCleanup:b,onClosed:b,overlayClose:f,escKey:f,arrowKey:f},s="colorbox",j="cbox",hb=j+"_open",W=j+"_load",V=j+"_complete",jb=j+"_cleanup",fb=j+"_closed",R=j+"_purge",kb=j+"_loaded",D=c.browser.msie&&!c.support.opacity,Y=D&&c.browser.version<7,Q=j+"_IE6",A,h,E,t,cb,db,T,S,i,n,k,L,M,ab,Z,z,K,J,bb,F,G,B,C,l,X,g,a,w,H,P=b,d,I=j+"Element";d=c.fn[s]=c[s]=function(b,e){var a=this,d;if(!a[0]&&a.selector)return a;b=b||{};if(e)b.onComplete=e;if(!a[0]||a.selector===undefined){a=c("<a/>");b.open=f}a.each(function(){c.data(this,s,c.extend({},c.data(this,s)||ib,b));c(this).addClass(I)});d=b.open;if(c.isFunction(d))d=d.call(a);d&&gb(a[0]);return a};d.init=function(){var l="hover",m="clear:left";n=c(lb);h=e().attr({id:s,"class":D?j+"IE":""});A=e("Overlay",Y?"position:absolute":"").hide();E=e("Wrapper");t=e("Content").append(k=e(N,"width:0; height:0; overflow:hidden"),M=e("LoadingOverlay").add(e("LoadingGraphic")),ab=e("Title"),Z=e("Current"),K=e("Next"),J=e("Previous"),z=e("Slideshow").bind(hb,mb),bb=e("Close"));E.append(e().append(e("TopLeft"),cb=e("TopCenter"),e("TopRight")),e(b,m).append(db=e("MiddleLeft"),t,T=e("MiddleRight")),e(b,m).append(e("BottomLeft"),S=e("BottomCenter"),e("BottomRight"))).children().children().css({"float":"left"});L=e(b,"position:absolute; width:9999px; visibility:hidden; display:none");c("body").prepend(A,h.append(E,L));t.children().hover(function(){c(this).addClass(l)},function(){c(this).removeClass(l)}).addClass(l);F=cb.height()+S.height()+t.outerHeight(f)-t.height();G=db.width()+T.width()+t.outerWidth(f)-t.width();B=k.outerHeight(f);C=k.outerWidth(f);h.css({"padding-bottom":F,"padding-right":G}).hide();K.click(d.next);J.click(d.prev);bb.click(d.close);t.children().removeClass(l);c("."+I).live(u,function(a){if(!(a.button!==0&&typeof a.button!=="undefined"||a.ctrlKey||a.shiftKey||a.altKey)){a.preventDefault();gb(this)}});A.click(function(){a.overlayClose&&d.close()});c(document).bind("keydown",function(b){if(w&&a.escKey&&b.keyCode===27){b.preventDefault();d.close()}if(w&&a.arrowKey&&!H&&i[1])if(b.keyCode===37&&(g||a.loop)){b.preventDefault();J.click()}else if(b.keyCode===39&&(g<i.length-1||a.loop)){b.preventDefault();K.click()}})};d.remove=function(){h.add(A).remove();c("."+I).die(u).removeData(s).removeClass(I)};d.position=function(f,c){function d(a){cb[0].style.width=S[0].style.width=t[0].style.width=a.style.width;M[0].style.height=M[1].style.height=t[0].style.height=db[0].style.height=T[0].style.height=a.style.height}var e,i=Math.max(document.documentElement.clientHeight-a.h-B-F,0)/2+n.scrollTop(),g=Math.max(n.width()-a.w-C-G,0)/2+n.scrollLeft();e=h.width()===a.w+C&&h.height()===a.h+B?0:f;E[0].style.width=E[0].style.height="9999px";h.dequeue().animate({width:a.w+C,height:a.h+B,top:i,left:g},{duration:e,complete:function(){d(this);H=b;E[0].style.width=a.w+C+G+"px";E[0].style.height=a.h+B+F+"px";c&&c()},step:function(){d(this)}})};d.resize=function(b){if(w){b=b||{};if(b.width)a.w=p(b.width,m)-C-G;if(b.innerWidth)a.w=p(b.innerWidth,m);k.css({width:a.w});if(b.height)a.h=p(b.height,o)-B-F;if(b.innerHeight)a.h=p(b.innerHeight,o);if(!b.innerHeight&&!b.height){b=k.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}k.css({height:a.h});d.position(a.transition===v?0:a.speed)}};d.prep=function(o){var f="hidden";function m(t){var m,r,f,o,e=i.length,q=a.loop;d.position(t,function(){if(w){D&&p&&k.fadeIn(100);k.show();y(kb);ab.show().html(a.title);if(e>1){Z.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,e)).show();K[q||g<e-1?"show":"hide"]().html(a.next);J[q||g?"show":"hide"]().html(a.previous);m=g?i[g-1]:i[e-1];f=g<e-1?i[g+1]:i[0];if(a.slideshow){z.show();g===e-1&&!q&&h.is("."+j+"Slideshow_on")&&z.click()}if(a.preloading){o=c.data(f,s).href||f.href;r=c.data(m,s).href||m.href;if(U(o,f))c("<img/>")[0].src=o;if(U(r,m))c("<img/>")[0].src=r}}M.hide();if(a.transition==="fade")h.fadeTo(l,1,function(){if(D)h[0].style.filter=b});else if(D)h[0].style.filter=b;n.bind(x+j,function(){d.position(0)});y(V,a.onComplete)}})}if(w){var p,l=a.transition===v?0:a.speed;n.unbind(x+j);k.remove();k=e(N).html(o);k.hide().appendTo(L.show()).css({width:function(){a.w=a.w||k.width();a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?r:f}).css({height:function(){a.h=a.h||k.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(t);L.hide();c("#"+j+"Photo").css({cssFloat:v,marginLeft:r,marginRight:r});Y&&c("select").not(h.find("select")).filter(function(){return this.style.visibility!==f}).css({visibility:f}).one(jb,function(){this.style.visibility="inherit"});a.transition==="fade"?h.fadeTo(l,0,function(){m(0)}):m(l)}};d.load=function(t){var n,b,r,q=d.prep;H=f;l=i[g];t||(a=eb(c.extend({},c.data(l,s))));y(R);y(W,a.onLoad);a.h=a.height?p(a.height,o)-B-F:a.innerHeight&&p(a.innerHeight,o);a.w=a.width?p(a.width,m)-C-G:a.innerWidth&&p(a.innerWidth,m);a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=p(a.maxWidth,m)-C-G;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=p(a.maxHeight,o)-B-F;a.mh=a.h&&a.h<a.mh?a.h:a.mh}n=a.href;M.show();if(a.inline){e().hide().insertBefore(c(n)[0]).one(R,function(){c(this).replaceWith(k.children())});q(c(n))}else if(a.iframe){h.one(kb,function(){var b=c("<iframe name='"+(new Date).getTime()+"' frameborder=0"+(a.scrolling?"":" scrolling='no'")+(D?" allowtransparency='true'":"")+" style='width:100%; height:100%; border:0; display:block;'/>");b[0].src=a.href;b.appendTo(k).one(R,function(){b[0].src="about:blank"})});q(" ")}else if(a.html)q(a.html);else if(U(n,l)){b=new Image;b.onload=function(){var e;b.onload=null;b.id=j+"Photo";c(b).css({border:v,display:"block",cssFloat:"left"});if(a.scalePhotos){r=function(){b.height-=b.height*e;b.width-=b.width*e};if(a.mw&&b.width>a.mw){e=(b.width-a.mw)/b.width;r()}if(a.mh&&b.height>a.mh){e=(b.height-a.mh)/b.height;r()}}if(a.h)b.style.marginTop=Math.max(a.h-b.height,0)/2+"px";i[1]&&(g<i.length-1||a.loop)&&c(b).css({cursor:"pointer"}).click(d.next);if(D)b.style.msInterpolationMode="bicubic";setTimeout(function(){q(b)},1)};setTimeout(function(){b.src=n},1)}else e().appendTo(L).load(n,function(c,a,b){q(a==="error"?"Request unsuccessful: "+b.statusText:this)})};d.next=function(){if(!H){g=g<i.length-1?g+1:0;d.load()}};d.prev=function(){if(!H){g=g?g-1:i.length-1;d.load()}};d.close=function(){if(w&&!P){P=f;w=b;y(jb,a.onCleanup);n.unbind("."+j+" ."+Q);A.fadeTo("fast",0);h.stop().fadeTo("fast",0,function(){y(R);k.remove();h.add(A).css({opacity:1,cursor:r}).hide();try{X.focus()}catch(c){}setTimeout(function(){P=b;y(fb,a.onClosed)},1)})}};d.element=function(){return c(l)};d.settings=ib;c(d.init)})(jQuery,this)
\ No newline at end of file diff --git a/javascript/jQuery.Sortable.css b/javascript/jQuery.Sortable.css new file mode 100644 index 0000000..9f7938f --- /dev/null +++ b/javascript/jQuery.Sortable.css @@ -0,0 +1,4 @@ +.sortable li { margin: 5px; padding: 5px; cursor:move; } +html>body .sortable li { border:1px solid #CCCCCC;} +.ui-state-highlight { height: 1.5em; line-height: 1.2em; border:1px solid #FED22F; background: #EEC21F} +.ui-sortable-helper {background:#EEEEEE;}
\ No newline at end of file |
