diff options
| author | spiderr <spider@viovio.com> | 2010-12-28 18:19:26 -0500 |
|---|---|---|
| committer | spiderr <spider@viovio.com> | 2010-12-28 18:19:26 -0500 |
| commit | baf50d300357cb6d1b24926b32a52459e488851a (patch) | |
| tree | e5a764a6a8c5fb5eb2f3df533a16910b4672fb8a | |
| parent | 1dddd8f2974b917f65fcdd7108673e4cbefec426 (diff) | |
| download | util-baf50d300357cb6d1b24926b32a52459e488851a.tar.gz util-baf50d300357cb6d1b24926b32a52459e488851a.tar.bz2 util-baf50d300357cb6d1b24926b32a52459e488851a.zip | |
new plugins
38 files changed, 2026 insertions, 0 deletions
diff --git a/javascript/libs/jquery/plugins/colorbox/colorbox.css b/javascript/libs/jquery/plugins/colorbox/colorbox.css new file mode 100755 index 0000000..a6e3b5b --- /dev/null +++ b/javascript/libs/jquery/plugins/colorbox/colorbox.css @@ -0,0 +1,36 @@ +/*
+ 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;}
+#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;}
+
+/*
+ ColorBox 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:#222;}
+
+#colorbox{}
+ #cboxContent{margin-top:20px;}
+ #cboxLoadedContent{background:#222; padding:5px;}
+ #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
+ #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
+ #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
+ #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(images/controls.png) top left no-repeat; width:28px; height:65px; text-indent:-9999px;}
+ #cboxPrevious.hover{background-position:bottom left;}
+ #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(images/controls.png) top right no-repeat; width:28px; height:65px; text-indent:-9999px;}
+ #cboxNext.hover{background-position:bottom right;}
+ #cboxLoadingOverlay{background:#000;}
+ #cboxLoadingGraphic{background:url(images/loading.gif) center center no-repeat;}
+ #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(images/controls.png) top center no-repeat; width:38px; height:19px; text-indent:-9999px;}
+ #cboxClose.hover{background-position:bottom center;}
diff --git a/javascript/libs/jquery/plugins/colorbox/images/controls.png b/javascript/libs/jquery/plugins/colorbox/images/controls.png Binary files differnew file mode 100755 index 0000000..e1e9798 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorbox/images/controls.png diff --git a/javascript/libs/jquery/plugins/colorbox/images/loading.gif b/javascript/libs/jquery/plugins/colorbox/images/loading.gif Binary files differnew file mode 100755 index 0000000..19c67bb --- /dev/null +++ b/javascript/libs/jquery/plugins/colorbox/images/loading.gif diff --git a/javascript/libs/jquery/plugins/colorbox/jquery.colorbox-min.js b/javascript/libs/jquery/plugins/colorbox/jquery.colorbox-min.js new file mode 100755 index 0000000..2a682ff --- /dev/null +++ b/javascript/libs/jquery/plugins/colorbox/jquery.colorbox-min.js @@ -0,0 +1,2 @@ +/* ColorBox v1.3.7 - a full featured, light-weight, customizable lightbox based on jQuery 1.3 */ +(function(c){function o(b,d){d=d==="x"?n.width():n.height();return typeof b==="string"?Math.round(b.match(/%/)?d/100*parseInt(b,10):parseInt(b,10)):b}function K(b){b=c.isFunction(b)?b.call(h):b;return a.photo||b.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i)}function Y(){for(var b in a)if(c.isFunction(a[b])&&b.substring(0,2)!=="on")a[b]=a[b].call(h);a.rel=a.rel||h.rel||"nofollow";a.href=a.href||c(h).attr("href");a.title=a.title||h.title}function Z(b){h=b;a=c.extend({},c(h).data(s)); Y();if(a.rel!=="nofollow"){j=c(".cboxElement").filter(function(){return(c(this).data(s).rel||this.rel)===a.rel});g=j.index(h);if(g<0){j=j.add(h);g=j.length-1}}else{j=c(h);g=0}if(!q){A=q=l;L=h;try{L.blur()}catch(d){}c.event.trigger(ba);a.onOpen&&a.onOpen.call(h);r.css({opacity:parseFloat(a.opacity),cursor:a.overlayClose?"pointer":"auto"}).show();a.w=o(a.initialWidth,"x");a.h=o(a.initialHeight,"y");e.position(0);M&&n.bind("resize.cboxIE6 scroll.cboxIE6",function(){r.css({width:n.width(),height:n.height(), top:n.scrollTop(),left:n.scrollLeft()})}).trigger("scroll.cboxIE6")}N.add(E).add(F).add(t).add(O).hide();P.html(a.close).show();e.slideshow();e.load()}var s="colorbox",l=true,e,B=c.browser.msie&&!c.support.opacity,M=B&&c.browser.version<7,ba="cbox_open",I="cbox_load",Q="cbox_complete",r,k,x,p,R,S,T,U,j,n,m,J,G,O,N,t,F,E,P,y,z,u,v,h,L,g,a,q,A,$={transition:"elastic",speed:350,width:false,height:false,innerWidth:false,innerHeight:false,initialWidth:"400",initialHeight:"400",maxWidth:false,maxHeight:false, scalePhotos:l,scrolling:l,inline:false,html:false,iframe:false,photo:false,href:false,title:false,rel:false,opacity:0.9,preloading:l,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:false,overlayClose:l,loop:l,slideshow:false,slideshowAuto:l,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false,escKey:l,arrowKey:l};e=c.fn.colorbox=c.colorbox=function(b,d){var f= this;if(f.selector&&!f.length)return f;b=b||{};if(d)b.onComplete=d;if(!f.length||f.selector===undefined){f=c("<a/>");b.open=l}f.each(function(){c(this).data(s,c.extend({},c(this).data(s)||$,b)).addClass("cboxElement")});b.open&&Z(f[0]);return f};e.init=function(){function b(d){return c('<div id="cbox'+d+'"/>')}n=c(window);k=c('<div id="colorbox"/>');r=b("Overlay").hide();x=b("Wrapper");p=b("Content").append(m=b("LoadedContent").css({width:0,height:0}),G=b("LoadingOverlay").add(b("LoadingGraphic")), O=b("Title"),N=b("Current"),F=b("Next"),E=b("Previous"),t=b("Slideshow"),P=b("Close"));x.append(c("<div/>").append(b("TopLeft"),R=b("TopCenter"),b("TopRight")),c("<div/>").append(S=b("MiddleLeft"),p,T=b("MiddleRight")),c("<div/>").append(b("BottomLeft"),U=b("BottomCenter"),b("BottomRight"))).children().children().css({"float":"left"});J=c("<div id='cboxLoadingBay' style='position:absolute; width:9999px;'/>");c("body").prepend(r,k.append(x,J));if(B){k.addClass("cboxIE");M&&r.css("position","absolute")}p.children().hover(function(){c(this).addClass("hover")}, function(){c(this).removeClass("hover")}).addClass("hover");y=R.height()+U.height()+p.outerHeight(l)-p.height();z=S.width()+T.width()+p.outerWidth(l)-p.width();u=m.outerHeight(l);v=m.outerWidth(l);k.css({"padding-bottom":y,"padding-right":z}).hide();F.click(e.next);E.click(e.prev);P.click(e.close);p.children().removeClass("hover");c(".cboxElement").live("click",function(d){if(d.button!==0&&typeof d.button!=="undefined"||d.ctrlKey||d.shiftKey||d.altKey)return l;else{Z(this);return false}});r.click(function(){a.overlayClose&& e.close()});c(document).bind("keydown",function(d){if(q&&a.escKey&&d.keyCode===27){d.preventDefault();e.close()}if(q&&a.arrowKey&&!A&&j.length>1)if(d.keyCode===37&&(g>0||a.loop)){d.preventDefault();E.click()}else if(d.keyCode===39&&(g<j.length-1||a.loop)){d.preventDefault();F.click()}})};e.remove=function(){k.add(r).remove();c(".cboxElement").removeData(s).removeClass("cboxElement")};e.position=function(b,d){function f(C){R[0].style.width=U[0].style.width=p[0].style.width=C.style.width;G[0].style.height= G[1].style.height=p[0].style.height=S[0].style.height=T[0].style.height=C.style.height}var i,w=Math.max(n.height()-a.h-u-y,0)/2+n.scrollTop(),H=Math.max(n.width()-a.w-v-z,0)/2+n.scrollLeft();i=k.width()===a.w+v&&k.height()===a.h+u?0:b;x[0].style.width=x[0].style.height="9999px";k.dequeue().animate({width:a.w+v,height:a.h+u,top:w,left:H},{duration:i,complete:function(){f(this);A=false;x[0].style.width=a.w+v+z+"px";x[0].style.height=a.h+u+y+"px";d&&d()},step:function(){f(this)}})};e.resize=function(b){if(q){b= b||{};if(b.width)a.w=o(b.width,"x")-v-z;if(b.innerWidth)a.w=o(b.innerWidth,"x");m.css({width:a.w});if(b.height)a.h=o(b.height,"y")-u-y;if(b.innerHeight)a.h=o(b.innerHeight,"y");if(!b.innerHeight&&!b.height){b=m.wrapInner("<div style='overflow:auto'></div>").children();a.h=b.height();b.replaceWith(b.children())}m.css({height:a.h});e.position(a.transition==="none"?0:a.speed)}};e.prep=function(b){function d(w){var H,C,V,W,D=j.length,X=a.loop;e.position(w,function(){function aa(){B&&k[0].style.removeAttribute("filter")} if(q){B&&f&&m.fadeIn(100);if(a.iframe)c("<iframe frameborder=0"+(a.scrolling?"":" scrolling='no'")+(B?" allowtransparency='true'":"")+"/>").appendTo(m).attr({src:a.href,id:"cboxIframe",name:(new Date).getTime()});m.show();O.show().html(a.title);if(D>1){N.html(a.current.replace(/\{current\}/,g+1).replace(/\{total\}/,D)).show();F[X||g<D-1?"show":"hide"]().html(a.next);E[X||g>0?"show":"hide"]().html(a.previous);H=g>0?j[g-1]:j[D-1];V=g<D-1?j[g+1]:j[0];if(a.slideshow){t.show();g===D-1&&!X&&k.is(".cboxSlideshow_on")&& t.click()}if(a.preloading){W=c(V).data(s).href||V.href;C=c(H).data(s).href||H.href;if(K(W))c("<img/>")[0].src=W;if(K(C))c("<img/>")[0].src=C}}G.hide();a.transition==="fade"?k.fadeTo(i,1,function(){aa()}):aa();n.bind("resize.cbox",function(){e.position(0)});c.event.trigger(Q);a.onComplete&&a.onComplete.call(h)}})}if(q){var f,i=a.transition==="none"?0:a.speed;n.unbind("resize.cbox");m.remove();m=c('<div id="cboxLoadedContent"/>').html(b);m.hide().appendTo(J).css({width:function(){a.w=a.w||m.width(); a.w=a.mw&&a.mw<a.w?a.mw:a.w;return a.w}(),overflow:a.scrolling?"auto":"hidden"}).css({height:function(){a.h=a.h||m.height();a.h=a.mh&&a.mh<a.h?a.mh:a.h;return a.h}()}).prependTo(p);c("#cboxPhoto").css({cssFloat:"none"});M&&c("select:not(#colorbox select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("cbox_cleanup",function(){this.style.visibility="inherit"});a.transition==="fade"?k.fadeTo(i,0,function(){d(0)}):d(i)}};e.load=function(){var b,d,f,i=e.prep; A=l;h=j[g];a=c.extend({},c(h).data(s));Y();c.event.trigger(I);a.onLoad&&a.onLoad.call(h);a.h=a.height?o(a.height,"y")-u-y:a.innerHeight?o(a.innerHeight,"y"):false;a.w=a.width?o(a.width,"x")-v-z:a.innerWidth?o(a.innerWidth,"x"):false;a.mw=a.w;a.mh=a.h;if(a.maxWidth){a.mw=o(a.maxWidth,"x")-v-z;a.mw=a.w&&a.w<a.mw?a.w:a.mw}if(a.maxHeight){a.mh=o(a.maxHeight,"y")-u-y;a.mh=a.h&&a.h<a.mh?a.h:a.mh}b=a.href;G.show();if(a.inline){c('<div id="cboxInlineTemp"/>').hide().insertBefore(c(b)[0]).bind(I+" cbox_cleanup", function(){c(this).replaceWith(m.children())});i(c(b))}else if(a.iframe)i(" ");else if(a.html)i(a.html);else if(K(b)){d=new Image;d.onload=function(){var w;d.onload=null;d.id="cboxPhoto";c(d).css({margin:"auto",border:"none",display:"block",cssFloat:"left"});if(a.scalePhotos){f=function(){d.height-=d.height*w;d.width-=d.width*w};if(a.mw&&d.width>a.mw){w=(d.width-a.mw)/d.width;f()}if(a.mh&&d.height>a.mh){w=(d.height-a.mh)/d.height;f()}}if(a.h)d.style.marginTop=Math.max(a.h-d.height,0)/2+"px";i(d); j.length>1&&c(d).css({cursor:"pointer"}).click(e.next);if(B)d.style.msInterpolationMode="bicubic"};d.src=b}else c("<div>Request unsuccessful.</div>").appendTo(J).load(b,function(){i(this)})};e.next=function(){if(!A){g=g<j.length-1?g+1:0;e.load()}};e.prev=function(){if(!A){g=g>0?g-1:j.length-1;e.load()}};e.slideshow=function(){function b(){t.text(a.slideshowStop).bind(Q,function(){f=setTimeout(e.next,a.slideshowSpeed)}).bind(I,function(){clearTimeout(f)}).one("click",function(){d()});k.removeClass(i+ "off").addClass(i+"on")}var d,f,i="cboxSlideshow_";t.bind("cbox_closed",function(){t.unbind();clearTimeout(f);k.removeClass(i+"off "+i+"on")});d=function(){clearTimeout(f);t.text(a.slideshowStart).unbind(Q+" "+I).one("click",function(){b();f=setTimeout(e.next,a.slideshowSpeed)});k.removeClass(i+"on").addClass(i+"off")};if(a.slideshow&&j.length>1)a.slideshowAuto?b():d()};e.close=function(){if(q){q=false;c.event.trigger("cbox_cleanup");a.onCleanup&&a.onCleanup.call(h);n.unbind(".cbox .cboxIE6");k.add(r).stop().fadeTo("fast", 0,function(){c("#colorbox iframe").attr("src","about:blank");m.remove();k.add(r).css({opacity:1,cursor:"auto"}).hide();try{L.focus()}catch(b){}setTimeout(function(){c.event.trigger("cbox_closed");a.onClosed&&a.onClosed.call(h)},1)})}};e.element=function(){return c(h)};e.settings=$;c(e.init)})(jQuery); diff --git a/javascript/libs/jquery/plugins/colorbox/jquery.colorbox.js b/javascript/libs/jquery/plugins/colorbox/jquery.colorbox.js new file mode 100755 index 0000000..c4b3aa7 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorbox/jquery.colorbox.js @@ -0,0 +1,772 @@ +// ColorBox v1.3.7 - a full featured, light-weight, customizable lightbox based on jQuery 1.3
+// c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
+// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+
+/*jslint browser: true */
+
+(function ($) {
+ // Shortcuts (to increase compression)
+ var colorbox = 'colorbox',
+ hover = 'hover',
+ TRUE = true,
+ FALSE = false,
+ cboxPublic,
+ isIE = $.browser.msie && !$.support.opacity, // feature detection alone gave a false positive on at least one phone browser
+ isIE6 = isIE && $.browser.version < 7,
+
+ // Event Strings (to increase compression)
+ cbox_open = 'cbox_open',
+ cbox_load = 'cbox_load',
+ cbox_complete = 'cbox_complete',
+ cbox_cleanup = 'cbox_cleanup',
+ cbox_closed = 'cbox_closed',
+
+ // Cached jQuery Object Variables
+ $overlay,
+ $cbox,
+ $wrap,
+ $content,
+ $topBorder,
+ $leftBorder,
+ $rightBorder,
+ $bottomBorder,
+ $related,
+ $window,
+ $loaded,
+ $loadingBay,
+ $loadingOverlay,
+ $title,
+ $current,
+ $slideshow,
+ $next,
+ $prev,
+ $close,
+
+ // Variables for cached values or use across multiple functions
+ interfaceHeight,
+ interfaceWidth,
+ loadedHeight,
+ loadedWidth,
+ element,
+ bookmark,
+ index,
+ settings,
+ open,
+ active,
+
+ // ColorBox Default Settings.
+ // See http://colorpowered.com/colorbox for details.
+ defaults = {
+ transition: "elastic",
+ speed: 350,
+ width: FALSE,
+ height: FALSE,
+ innerWidth: FALSE,
+ innerHeight: FALSE,
+ initialWidth: "400",
+ initialHeight: "400",
+ maxWidth: FALSE,
+ maxHeight: FALSE,
+ scalePhotos: TRUE,
+ scrolling: TRUE,
+ inline: FALSE,
+ html: FALSE,
+ iframe: FALSE,
+ photo: FALSE,
+ href: FALSE,
+ title: FALSE,
+ rel: FALSE,
+ opacity: 0.9,
+ preloading: TRUE,
+ current: "image {current} of {total}",
+ previous: "previous",
+ next: "next",
+ close: "close",
+ open: FALSE,
+ overlayClose: TRUE,
+ loop: TRUE,
+
+ slideshow: FALSE,
+ slideshowAuto: TRUE,
+ slideshowSpeed: 2500,
+ slideshowStart: "start slideshow",
+ slideshowStop: "stop slideshow",
+
+ onOpen: FALSE,
+ onLoad: FALSE,
+ onComplete: FALSE,
+ onCleanup: FALSE,
+ onClosed: FALSE,
+
+ escKey: TRUE,
+ arrowKey: TRUE
+ };
+
+ // ****************
+ // HELPER FUNCTIONS
+ // ****************
+
+ // Convert % values to pixels
+ function setSize(size, dimension) {
+ dimension = dimension === 'x' ? $window.width() : $window.height();//document.documentElement.clientWidth : document.documentElement.clientHeight;
+ return (typeof size === 'string') ? Math.round((size.match(/%/) ? (dimension / 100) * parseInt(size, 10) : parseInt(size, 10))) : size;
+ }
+
+ // Checks an href to see if it is a photo.
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by this regex.
+ function isImage(url) {
+ url = $.isFunction(url) ? url.call(element) : url;
+ return settings.photo || url.match(/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i);
+ }
+
+ // Assigns functions results to their respective settings. This allows functions to be used to set ColorBox options.
+ function process() {
+ for (var i in settings) {
+ if ($.isFunction(settings[i]) && i.substring(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
+ settings[i] = settings[i].call(element);
+ }
+ }
+ settings.rel = settings.rel || element.rel || 'nofollow';
+ settings.href = settings.href || $(element).attr('href');
+ settings.title = settings.title || element.title;
+ }
+
+ function launch(elem) {
+
+ element = elem;
+
+ settings = $.extend({}, $(element).data(colorbox));
+
+ process(); // Convert functions to their returned values.
+
+ if (settings.rel !== 'nofollow') {
+ $related = $('.cboxElement').filter(function () {
+ var relRelated = $(this).data(colorbox).rel || this.rel;
+ return (relRelated === settings.rel);
+ });
+ index = $related.index(element);
+
+ // Check direct calls to ColorBox.
+ if (index < 0) {
+ $related = $related.add(element);
+ index = $related.length - 1;
+ }
+ } else {
+ $related = $(element);
+ index = 0;
+ }
+
+ if (!open) {
+ open = TRUE;
+
+ active = TRUE; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
+
+ bookmark = element;
+
+ try {
+ bookmark.blur(); // Remove the focus from the calling element.
+ }catch (e) {}
+
+ $.event.trigger(cbox_open);
+ if (settings.onOpen) {
+ settings.onOpen.call(element);
+ }
+
+ $overlay.css({"opacity": parseFloat(settings.opacity), "cursor": settings.overlayClose ? "pointer" : "auto"}).show();
+
+ // Opens inital empty ColorBox prior to content being loaded.
+ settings.w = setSize(settings.initialWidth, 'x');
+ settings.h = setSize(settings.initialHeight, 'y');
+ cboxPublic.position(0);
+
+ if (isIE6) {
+ $window.bind('resize.cboxIE6 scroll.cboxIE6', function () {
+ $overlay.css({width: $window.width(), height: $window.height(), top: $window.scrollTop(), left: $window.scrollLeft()});
+ }).trigger("scroll.cboxIE6");
+ }
+ }
+
+ $current.add($prev).add($next).add($slideshow).add($title).hide();
+
+ $close.html(settings.close).show();
+
+ cboxPublic.slideshow();
+
+ cboxPublic.load();
+ }
+
+ // ****************
+ // PUBLIC FUNCTIONS
+ // Usage format: $.fn.colorbox.close();
+ // Usage from within an iframe: parent.$.fn.colorbox.close();
+ // ****************
+
+ cboxPublic = $.fn.colorbox = $.colorbox = function (options, callback) {
+ var $this = this;
+
+ if ($this.selector && !$this.length) {
+ return $this;
+ }
+
+ options = options || {};
+
+ if (callback) {
+ options.onComplete = callback;
+ }
+
+ if (!$this.length || $this.selector === undefined) { // detects $.colorbox() and $.fn.colorbox()
+ $this = $('<a/>');
+ options.open = TRUE; // assume an immediate open
+ }
+
+ $this.each(function () {
+ $(this).data(colorbox, $.extend({}, $(this).data(colorbox) || defaults, options)).addClass("cboxElement");
+ });
+
+ if (options.open) {
+ launch($this[0]);
+ }
+
+ return $this;
+ };
+
+ // Initialize ColorBox: store common calculations, preload the interface graphics, append the html.
+ // This preps colorbox for a speedy open when clicked, and lightens the burdon on the browser by only
+ // having to run once, instead of each time colorbox is opened.
+ cboxPublic.init = function () {
+
+ // jQuery object generator to save a bit of space
+ function $div(id) {
+ return $('<div id="cbox' + id + '"/>');
+ }
+
+ // Create & Append jQuery Objects
+ $window = $(window);
+ $cbox = $('<div id="colorbox"/>');
+ $overlay = $div("Overlay").hide();
+ $wrap = $div("Wrapper");
+ $content = $div("Content").append(
+ $loaded = $div("LoadedContent").css({width: 0, height: 0}),
+ $loadingOverlay = $div("LoadingOverlay").add($div("LoadingGraphic")),
+ $title = $div("Title"),
+ $current = $div("Current"),
+ $next = $div("Next"),
+ $prev = $div("Previous"),
+ $slideshow = $div("Slideshow"),
+ $close = $div("Close")
+ );
+ $wrap.append( // The 3x3 Grid that makes up ColorBox
+ $('<div/>').append(
+ $div("TopLeft"),
+ $topBorder = $div("TopCenter"),
+ $div("TopRight")
+ ),
+ $('<div/>').append(
+ $leftBorder = $div("MiddleLeft"),
+ $content,
+ $rightBorder = $div("MiddleRight")
+ ),
+ $('<div/>').append(
+ $div("BottomLeft"),
+ $bottomBorder = $div("BottomCenter"),
+ $div("BottomRight")
+ )
+ ).children().children().css({'float': 'left'});
+
+ $loadingBay = $("<div id='cboxLoadingBay' style='position:absolute; width:9999px;'/>");
+
+ $('body').prepend($overlay, $cbox.append($wrap, $loadingBay));
+
+ if (isIE) {
+ $cbox.addClass('cboxIE');
+ if (isIE6) {
+ $overlay.css('position', 'absolute');
+ }
+ }
+
+ $content.children()
+ .hover(function () {
+ $(this).addClass(hover);
+ }, function () {
+ $(this).removeClass(hover);
+ }).addClass(hover);
+
+ // Cache values needed for size calculations
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(TRUE) - $content.height();//Subtraction needed for IE6
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(TRUE) - $content.width();
+ loadedHeight = $loaded.outerHeight(TRUE);
+ loadedWidth = $loaded.outerWidth(TRUE);
+
+ // Setting padding to remove the need to do size conversions during the animation step.
+ $cbox.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth}).hide();
+
+ // Setup button events.
+ $next.click(cboxPublic.next);
+ $prev.click(cboxPublic.prev);
+ $close.click(cboxPublic.close);
+
+ // Adding the 'hover' class allowed the browser to load the hover-state
+ // background graphics. The class can now can be removed.
+ $content.children().removeClass(hover);
+
+ $('.cboxElement').live('click', function (e) {
+ // checks to see if it was a non-left mouse-click and for clicks modified with ctrl, shift, or alt.
+ if ((e.button !== 0 && typeof e.button !== 'undefined') || e.ctrlKey || e.shiftKey || e.altKey) {
+ return TRUE;
+ } else {
+ launch(this);
+ return FALSE;
+ }
+ });
+
+ $overlay.click(function () {
+ if (settings.overlayClose) {
+ cboxPublic.close();
+ }
+ });
+
+ // Set Navigation Key Bindings
+ $(document).bind("keydown", function (e) {
+ if (open && settings.escKey && e.keyCode === 27) {
+ e.preventDefault();
+ cboxPublic.close();
+ }
+ if (open && settings.arrowKey && !active && $related.length > 1) {
+ if (e.keyCode === 37 && (index > 0 || settings.loop)) {
+ e.preventDefault();
+ $prev.click();
+ } else if (e.keyCode === 39 && (index < $related.length - 1 || settings.loop)) {
+ e.preventDefault();
+ $next.click();
+ }
+ }
+ });
+ };
+
+ cboxPublic.remove = function () {
+ $cbox.add($overlay).remove();
+ $('.cboxElement').removeData(colorbox).removeClass('cboxElement');
+ };
+
+ cboxPublic.position = function (speed, loadedCallback) {
+ var
+ animate_speed,
+ // keeps the top and left positions within the browser's viewport.
+ posTop = Math.max($window.height() - settings.h - loadedHeight - interfaceHeight, 0) / 2 + $window.scrollTop(),
+ posLeft = Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2 + $window.scrollLeft();
+
+ // setting the speed to 0 to reduce the delay between same-sized content.
+ animate_speed = ($cbox.width() === settings.w + loadedWidth && $cbox.height() === settings.h + loadedHeight) ? 0 : speed;
+
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
+ // it can invoke an obscure IE bug when using iframes.
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
+
+ function modalDimensions(that) {
+ // loading overlay height has to be explicitly set for IE6.
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = that.style.width;
+ $loadingOverlay[0].style.height = $loadingOverlay[1].style.height = $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = that.style.height;
+ }
+
+ $cbox.dequeue().animate({width: settings.w + loadedWidth, height: settings.h + loadedHeight, top: posTop, left: posLeft}, {
+ duration: animate_speed,
+ complete: function () {
+ modalDimensions(this);
+
+ active = FALSE;
+
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
+
+ if (loadedCallback) {
+ loadedCallback();
+ }
+ },
+ step: function () {
+ modalDimensions(this);
+ }
+ });
+ };
+
+ cboxPublic.resize = function (options) {
+ if (open) {
+ options = options || {};
+
+ if (options.width) {
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
+ }
+ if (options.innerWidth) {
+ settings.w = setSize(options.innerWidth, 'x');
+ }
+ $loaded.css({width: settings.w});
+
+ if (options.height) {
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
+ }
+ if (options.innerHeight) {
+ settings.h = setSize(options.innerHeight, 'y');
+ }
+ if (!options.innerHeight && !options.height) {
+ var $child = $loaded.wrapInner("<div style='overflow:auto'></div>").children(); // temporary wrapper to get an accurate estimate of just how high the total content should be.
+ settings.h = $child.height();
+ $child.replaceWith($child.children()); // ditch the temporary wrapper div used in height calculation
+ }
+ $loaded.css({height: settings.h});
+
+ cboxPublic.position(settings.transition === "none" ? 0 : settings.speed);
+ }
+ };
+
+ cboxPublic.prep = function (object) {
+ if (!open) {
+ return;
+ }
+
+ var photo,
+ speed = settings.transition === "none" ? 0 : settings.speed;
+
+ $window.unbind('resize.cbox');
+
+ $loaded.remove();
+ $loaded = $('<div id="cboxLoadedContent"/>').html(object);
+
+ function getWidth() {
+ settings.w = settings.w || $loaded.width();
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
+ return settings.w;
+ }
+ function getHeight() {
+ settings.h = settings.h || $loaded.height();
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
+ return settings.h;
+ }
+
+ $loaded.hide()
+ .appendTo($loadingBay)// content has to be appended to the DOM for accurate size calculations.
+ .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
+ .prependTo($content);
+
+ $('#cboxPhoto').css({cssFloat: 'none'});// floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
+
+ // Hides SELECT elements in IE6 because they would otherwise sit on top of the overlay.
+ if (isIE6) {
+ $('select:not(#colorbox select)').filter(function () {
+ return this.style.visibility !== 'hidden';
+ }).css({'visibility': 'hidden'}).one(cbox_cleanup, function () {
+ this.style.visibility = 'inherit';
+ });
+ }
+
+ function setPosition(s) {
+ var prev, prevSrc, next, nextSrc, total = $related.length, loop = settings.loop;
+ cboxPublic.position(s, function () {
+ function defilter() {
+ if (isIE) {
+ //IE adds a filter when ColorBox fades in and out that can cause problems if the loaded content contains transparent pngs.
+ $cbox[0].style.removeAttribute("filter");
+ }
+ }
+
+ if (!open) {
+ return;
+ }
+
+ if (isIE) {
+ //This fadeIn helps the bicubic resampling to kick-in.
+ if (photo) {
+ $loaded.fadeIn(100);
+ }
+ }
+
+ //Waited until the iframe is added to the DOM & it is visible before setting the src.
+ //This increases compatability with pages using DOM dependent JavaScript.
+ if (settings.iframe) {
+ $("<iframe frameborder=0" + (settings.scrolling ? "" : " scrolling='no'") + (isIE ? " allowtransparency='true'" : '') + "/>")
+ .appendTo($loaded)
+ .attr({src: settings.href, id: 'cboxIframe', name: new Date().getTime()});
+ }
+
+ $loaded.show();
+
+ $title.show().html(settings.title);
+
+ if (total > 1) { // handle grouping
+ $current.html(settings.current.replace(/\{current\}/, index + 1).replace(/\{total\}/, total)).show();
+
+ $next[(loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
+ $prev[(loop || index > 0) ? "show" : "hide"]().html(settings.previous);
+
+ prev = index > 0 ? $related[index - 1] : $related[total - 1];
+ next = index < total - 1 ? $related[index + 1] : $related[0];
+
+ if (settings.slideshow) {
+ $slideshow.show();
+ if (index === total - 1 && !loop && $cbox.is('.cboxSlideshow_on')) {
+ $slideshow.click();
+ }
+ }
+
+ // Preloads images within a rel group
+ if (settings.preloading) {
+ nextSrc = $(next).data(colorbox).href || next.href;
+ prevSrc = $(prev).data(colorbox).href || prev.href;
+
+ if (isImage(nextSrc)) {
+ $('<img/>')[0].src = nextSrc;
+ }
+
+ if (isImage(prevSrc)) {
+ $('<img/>')[0].src = prevSrc;
+ }
+ }
+ }
+
+ $loadingOverlay.hide();
+
+ if (settings.transition === 'fade') {
+ $cbox.fadeTo(speed, 1, function () {
+ defilter();
+ });
+ } else {
+ defilter();
+ }
+
+ $window.bind('resize.cbox', function () {
+ cboxPublic.position(0);
+ });
+
+ $.event.trigger(cbox_complete);
+ if (settings.onComplete) {
+ settings.onComplete.call(element);
+ }
+ });
+ }
+
+ if (settings.transition === 'fade') {
+ $cbox.fadeTo(speed, 0, function () {
+ setPosition(0);
+ });
+ } else {
+ setPosition(speed);
+ }
+ };
+
+ cboxPublic.load = function () {
+ var href, img, setResize, prep = cboxPublic.prep;
+
+ active = TRUE;
+
+ element = $related[index];
+
+ settings = $.extend({}, $(element).data(colorbox));
+
+ //convert functions to static values
+ process();
+
+ $.event.trigger(cbox_load);
+ if (settings.onLoad) {
+ settings.onLoad.call(element);
+ }
+
+ // Evaluate the height based on the optional height and width settings.
+ settings.h = settings.height ?
+ setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
+ settings.innerHeight ?
+ setSize(settings.innerHeight, 'y') :
+ FALSE;
+ settings.w = settings.width ?
+ setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
+ settings.innerWidth ?
+ setSize(settings.innerWidth, 'x') :
+ FALSE;
+
+ // Sets the minimum dimensions for use in image scaling
+ settings.mw = settings.w;
+ settings.mh = settings.h;
+
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
+ if (settings.maxWidth) {
+ settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
+ }
+ if (settings.maxHeight) {
+ settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
+ }
+
+ href = settings.href;
+
+ $loadingOverlay.show();
+
+ if (settings.inline) {
+ // Inserts an empty placeholder where inline content is being pulled from.
+ // An event is bound to put inline content back when ColorBox closes or loads new content.
+ $('<div id="cboxInlineTemp"/>').hide().insertBefore($(href)[0]).bind(cbox_load + ' ' + cbox_cleanup, function () {
+ $(this).replaceWith($loaded.children());
+ });
+ prep($(href));
+ } else if (settings.iframe) {
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
+ prep(" ");
+ } else if (settings.html) {
+ prep(settings.html);
+ } else if (isImage(href)) {
+ img = new Image();
+ img.onload = function () {
+ var percent;
+
+ img.onload = null;
+ img.id = 'cboxPhoto';
+ $(img).css({margin: 'auto', border: 'none', display: 'block', cssFloat: 'left'});
+
+ if (settings.scalePhotos) {
+ setResize = function () {
+ img.height -= img.height * percent;
+ img.width -= img.width * percent;
+ };
+ if (settings.mw && img.width > settings.mw) {
+ percent = (img.width - settings.mw) / img.width;
+ setResize();
+ }
+ if (settings.mh && img.height > settings.mh) {
+ percent = (img.height - settings.mh) / img.height;
+ setResize();
+ }
+ }
+
+ if (settings.h) {
+ img.style.marginTop = Math.max(settings.h - img.height, 0) / 2 + 'px';
+ }
+
+ prep(img);
+
+ if ($related.length > 1) {
+ $(img).css({cursor: 'pointer'}).click(cboxPublic.next);
+ }
+
+ if (isIE) {
+ img.style.msInterpolationMode = 'bicubic';
+ }
+ };
+ img.src = href;
+ } else {
+ $('<div>Request unsuccessful.</div>').appendTo($loadingBay).load(href, function (data, textStatus) {
+ prep(this);
+ });
+ }
+ };
+
+ // Navigates to the next page/image in a set.
+ cboxPublic.next = function () {
+ if (!active) {
+ index = index < $related.length - 1 ? index + 1 : 0;
+ cboxPublic.load();
+ }
+ };
+
+ cboxPublic.prev = function () {
+ if (!active) {
+ index = index > 0 ? index - 1 : $related.length - 1;
+ cboxPublic.load();
+ }
+ };
+
+ cboxPublic.slideshow = function () {
+ var stop, timeOut, className = 'cboxSlideshow_';
+
+ $slideshow.bind(cbox_closed, function () {
+ $slideshow.unbind();
+ clearTimeout(timeOut);
+ $cbox.removeClass(className + "off " + className + "on");
+ });
+
+ function start() {
+ $slideshow
+ .text(settings.slideshowStop)
+ .bind(cbox_complete, function () {
+ timeOut = setTimeout(cboxPublic.next, settings.slideshowSpeed);
+ })
+ .bind(cbox_load, function () {
+ clearTimeout(timeOut);
+ }).one("click", function () {
+ stop();
+ });
+ $cbox.removeClass(className + "off").addClass(className + "on");
+ }
+
+ stop = function () {
+ clearTimeout(timeOut);
+ $slideshow
+ .text(settings.slideshowStart)
+ .unbind(cbox_complete + ' ' + cbox_load)
+ .one("click", function () {
+ start();
+ timeOut = setTimeout(cboxPublic.next, settings.slideshowSpeed);
+ });
+ $cbox.removeClass(className + "on").addClass(className + "off");
+ };
+
+ if (settings.slideshow && $related.length > 1) {
+ if (settings.slideshowAuto) {
+ start();
+ } else {
+ stop();
+ }
+ }
+ };
+
+ // Note: to use this within an iframe use the following format: parent.$.fn.colorbox.close();
+ cboxPublic.close = function () {
+ if (open) {
+ open = FALSE;
+
+ $.event.trigger(cbox_cleanup);
+
+ if (settings.onCleanup) {
+ settings.onCleanup.call(element);
+ }
+
+ $window.unbind('.cbox .cboxIE6');
+
+ $cbox.add($overlay)
+ .stop()
+ .fadeTo('fast', 0, function () {
+ $('#colorbox iframe').attr('src', 'about:blank'); // change the location of the iframe to avoid a problem in IE with flash objects not clearing.
+
+ $loaded.remove();
+
+ $cbox.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
+
+ try {
+ bookmark.focus();
+ } catch (e) {
+ // do nothing
+ }
+
+ setTimeout(function () {
+ $.event.trigger(cbox_closed);
+ if (settings.onClosed) {
+ settings.onClosed.call(element);
+ }
+ }, 1);
+ });
+ }
+ };
+
+ // A method for fetching the current element ColorBox is referencing.
+ // returns a jQuery object.
+ cboxPublic.element = function () {
+ return $(element);
+ };
+
+ cboxPublic.settings = defaults;
+
+ // Initializes ColorBox when the DOM has loaded
+ $(cboxPublic.init);
+
+}(jQuery));
diff --git a/javascript/libs/jquery/plugins/colorpicker/css/colorpicker.css b/javascript/libs/jquery/plugins/colorpicker/css/colorpicker.css new file mode 100755 index 0000000..4bb6ef1 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/css/colorpicker.css @@ -0,0 +1,161 @@ +.colorpicker {
+ width: 356px;
+ height: 176px;
+ overflow: hidden;
+ position: absolute;
+ background: url(../images/colorpicker_background.png);
+ font-family: Arial, Helvetica, sans-serif;
+ display: none;
+}
+.colorpicker_color {
+ width: 150px;
+ height: 150px;
+ left: 14px;
+ top: 13px;
+ position: absolute;
+ background: #f00;
+ overflow: hidden;
+ cursor: crosshair;
+}
+.colorpicker_color div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 150px;
+ height: 150px;
+ background: url(../images/colorpicker_overlay.png);
+}
+.colorpicker_color div div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 11px;
+ height: 11px;
+ overflow: hidden;
+ background: url(../images/colorpicker_select.gif);
+ margin: -5px 0 0 -5px;
+}
+.colorpicker_hue {
+ position: absolute;
+ top: 13px;
+ left: 171px;
+ width: 35px;
+ height: 150px;
+ cursor: n-resize;
+}
+.colorpicker_hue div {
+ position: absolute;
+ width: 35px;
+ height: 9px;
+ overflow: hidden;
+ background: url(../images/colorpicker_indic.gif) left top;
+ margin: -4px 0 0 0;
+ left: 0px;
+}
+.colorpicker_new_color {
+ position: absolute;
+ width: 60px;
+ height: 30px;
+ left: 213px;
+ top: 13px;
+ background: #f00;
+}
+.colorpicker_current_color {
+ position: absolute;
+ width: 60px;
+ height: 30px;
+ left: 283px;
+ top: 13px;
+ background: #f00;
+}
+.colorpicker input {
+ background-color: transparent;
+ border: 1px solid transparent;
+ position: absolute;
+ font-size: 10px;
+ font-family: Arial, Helvetica, sans-serif;
+ color: #898989;
+ top: 4px;
+ right: 11px;
+ text-align: right;
+ margin: 0;
+ padding: 0;
+ height: 11px;
+}
+.colorpicker_hex {
+ position: absolute;
+ width: 72px;
+ height: 22px;
+ background: url(../images/colorpicker_hex.png) top;
+ left: 212px;
+ top: 142px;
+}
+.colorpicker_hex input {
+ right: 6px;
+}
+.colorpicker_field {
+ height: 22px;
+ width: 62px;
+ background-position: top;
+ position: absolute;
+}
+.colorpicker_field span {
+ position: absolute;
+ width: 12px;
+ height: 22px;
+ overflow: hidden;
+ top: 0;
+ right: 0;
+ cursor: n-resize;
+}
+.colorpicker_rgb_r {
+ background-image: url(../images/colorpicker_rgb_r.png);
+ top: 52px;
+ left: 212px;
+}
+.colorpicker_rgb_g {
+ background-image: url(../images/colorpicker_rgb_g.png);
+ top: 82px;
+ left: 212px;
+}
+.colorpicker_rgb_b {
+ background-image: url(../images/colorpicker_rgb_b.png);
+ top: 112px;
+ left: 212px;
+}
+.colorpicker_hsb_h {
+ background-image: url(../images/colorpicker_hsb_h.png);
+ top: 52px;
+ left: 282px;
+}
+.colorpicker_hsb_s {
+ background-image: url(../images/colorpicker_hsb_s.png);
+ top: 82px;
+ left: 282px;
+}
+.colorpicker_hsb_b {
+ background-image: url(../images/colorpicker_hsb_b.png);
+ top: 112px;
+ left: 282px;
+}
+.colorpicker_submit {
+ position: absolute;
+ width: 22px;
+ height: 22px;
+ background: url(../images/custom_submit.png) top;
+ left: 322px;
+ top: 142px;
+ overflow: hidden;
+}
+.colorpicker_focus {
+ background-position: center;
+}
+.colorpicker_hex.colorpicker_focus {
+ background-position: bottom;
+}
+.colorpicker_submit.colorpicker_focus {
+ background-position: bottom;
+}
+.colorpicker_slider {
+ background-position: bottom;
+}
diff --git a/javascript/libs/jquery/plugins/colorpicker/css/layout.css b/javascript/libs/jquery/plugins/colorpicker/css/layout.css new file mode 100755 index 0000000..8b3f00f --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/css/layout.css @@ -0,0 +1,218 @@ +body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
+ margin:0;
+ padding:0;
+}
+table {
+ border-collapse:collapse;
+ border-spacing:0;
+}
+fieldset,img {
+ border:0;
+}
+address,caption,cite,code,dfn,em,strong,th,var {
+ font-style:normal;
+ font-weight:normal;
+}
+ol,ul {
+ list-style:none;
+}
+caption,th {
+ text-align:left;
+}
+h1,h2,h3,h4,h5,h6 {
+ font-size:100%;
+ font-weight:normal;
+}
+q:before,q:after {
+ content:'';
+}
+abbr,acronym { border:0;
+}
+html, body {
+ background-color: #fff;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 12px;
+ line-height: 18px;
+ color: #52697E;
+}
+body {
+ text-align: center;
+ overflow: auto;
+}
+.wrapper {
+ width: 700px;
+ margin: 0 auto;
+ text-align: left;
+}
+h1 {
+ font-size: 21px;
+ height: 47px;
+ line-height: 47px;
+ text-transform: uppercase;
+}
+.navigationTabs {
+ height: 23px;
+ line-height: 23px;
+ border-bottom: 1px solid #ccc;
+}
+.navigationTabs li {
+ float: left;
+ height: 23px;
+ line-height: 23px;
+ padding-right: 3px;
+}
+.navigationTabs li a{
+ float: left;
+ dispaly: block;
+ height: 23px;
+ line-height: 23px;
+ padding: 0 10px;
+ overflow: hidden;
+ color: #52697E;
+ background-color: #eee;
+ position: relative;
+ text-decoration: none;
+}
+.navigationTabs li a:hover {
+ background-color: #f0f0f0;
+}
+.navigationTabs li a.active {
+ background-color: #fff;
+ border: 1px solid #ccc;
+ border-bottom: 0px solid;
+}
+.tabsContent {
+ border: 1px solid #ccc;
+ border-top: 0px solid;
+ width: 698px;
+ overflow: hidden;
+}
+.tab {
+ padding: 16px;
+ display: none;
+}
+.tab h2 {
+ font-weight: bold;
+ font-size: 16px;
+}
+.tab h3 {
+ font-weight: bold;
+ font-size: 14px;
+ margin-top: 20px;
+}
+.tab p {
+ margin-top: 16px;
+ clear: both;
+}
+.tab ul {
+ margin-top: 16px;
+ list-style: disc;
+}
+.tab li {
+ margin: 10px 0 0 35px;
+}
+.tab a {
+ color: #8FB0CF;
+}
+.tab strong {
+ font-weight: bold;
+}
+.tab pre {
+ font-size: 11px;
+ margin-top: 20px;
+ width: 668px;
+ overflow: auto;
+ clear: both;
+}
+.tab table {
+ width: 100%;
+}
+.tab table td {
+ padding: 6px 10px 6px 0;
+ vertical-align: top;
+}
+.tab dt {
+ margin-top: 16px;
+}
+
+#colorSelector {
+ position: relative;
+ width: 36px;
+ height: 36px;
+ background: url(../images/select.png);
+}
+#colorSelector div {
+ position: absolute;
+ top: 3px;
+ left: 3px;
+ width: 30px;
+ height: 30px;
+ background: url(../images/select.png) center;
+}
+#colorSelector2 {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 36px;
+ height: 36px;
+ background: url(../images/select2.png);
+}
+#colorSelector2 div {
+ position: absolute;
+ top: 4px;
+ left: 4px;
+ width: 28px;
+ height: 28px;
+ background: url(../images/select2.png) center;
+}
+#colorpickerHolder2 {
+ top: 32px;
+ left: 0;
+ width: 356px;
+ height: 0;
+ overflow: hidden;
+ position: absolute;
+}
+#colorpickerHolder2 .colorpicker {
+ background-image: url(../images/custom_background.png);
+ position: absolute;
+ bottom: 0;
+ left: 0;
+}
+#colorpickerHolder2 .colorpicker_hue div {
+ background-image: url(../images/custom_indic.gif);
+}
+#colorpickerHolder2 .colorpicker_hex {
+ background-image: url(../images/custom_hex.png);
+}
+#colorpickerHolder2 .colorpicker_rgb_r {
+ background-image: url(../images/custom_rgb_r.png);
+}
+#colorpickerHolder2 .colorpicker_rgb_g {
+ background-image: url(../images/custom_rgb_g.png);
+}
+#colorpickerHolder2 .colorpicker_rgb_b {
+ background-image: url(../images/custom_rgb_b.png);
+}
+#colorpickerHolder2 .colorpicker_hsb_s {
+ background-image: url(../images/custom_hsb_s.png);
+ display: none;
+}
+#colorpickerHolder2 .colorpicker_hsb_h {
+ background-image: url(../images/custom_hsb_h.png);
+ display: none;
+}
+#colorpickerHolder2 .colorpicker_hsb_b {
+ background-image: url(../images/custom_hsb_b.png);
+ display: none;
+}
+#colorpickerHolder2 .colorpicker_submit {
+ background-image: url(../images/custom_submit.png);
+}
+#colorpickerHolder2 .colorpicker input {
+ color: #778398;
+}
+#customWidget {
+ position: relative;
+ height: 36px;
+}
diff --git a/javascript/libs/jquery/plugins/colorpicker/images/Thumbs.db b/javascript/libs/jquery/plugins/colorpicker/images/Thumbs.db Binary files differnew file mode 100755 index 0000000..d396c36 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/Thumbs.db diff --git a/javascript/libs/jquery/plugins/colorpicker/images/blank.gif b/javascript/libs/jquery/plugins/colorpicker/images/blank.gif Binary files differnew file mode 100755 index 0000000..75b945d --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/blank.gif diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_background.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_background.png Binary files differnew file mode 100755 index 0000000..8401572 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_background.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hex.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hex.png Binary files differnew file mode 100755 index 0000000..4e532d7 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hex.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_b.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_b.png Binary files differnew file mode 100755 index 0000000..dfac595 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_b.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_h.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_h.png Binary files differnew file mode 100755 index 0000000..3977ed9 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_h.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_s.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_s.png Binary files differnew file mode 100755 index 0000000..a2a6997 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_hsb_s.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_indic.gif b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_indic.gif Binary files differnew file mode 100755 index 0000000..f9fa95e --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_indic.gif diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_overlay.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_overlay.png Binary files differnew file mode 100755 index 0000000..561cdd9 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_overlay.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_b.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_b.png Binary files differnew file mode 100755 index 0000000..dfac595 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_b.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_g.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_g.png Binary files differnew file mode 100755 index 0000000..72b3276 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_g.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_r.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_r.png Binary files differnew file mode 100755 index 0000000..4855fe0 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_rgb_r.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_select.gif b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_select.gif Binary files differnew file mode 100755 index 0000000..599f7f1 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_select.gif diff --git a/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_submit.png b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_submit.png Binary files differnew file mode 100755 index 0000000..7f4c082 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/colorpicker_submit.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_background.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_background.png Binary files differnew file mode 100755 index 0000000..cf55ffd --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_background.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_hex.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_hex.png Binary files differnew file mode 100755 index 0000000..888f444 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_hex.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_b.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_b.png Binary files differnew file mode 100755 index 0000000..2f99dae --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_b.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_h.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_h.png Binary files differnew file mode 100755 index 0000000..a217e92 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_h.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_s.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_s.png Binary files differnew file mode 100755 index 0000000..7826b41 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_hsb_s.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_indic.gif b/javascript/libs/jquery/plugins/colorpicker/images/custom_indic.gif Binary files differnew file mode 100755 index 0000000..222fb94 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_indic.gif diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_b.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_b.png Binary files differnew file mode 100755 index 0000000..80764e5 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_b.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_g.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_g.png Binary files differnew file mode 100755 index 0000000..fc9778b --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_g.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_r.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_r.png Binary files differnew file mode 100755 index 0000000..91b0cd4 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_rgb_r.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/custom_submit.png b/javascript/libs/jquery/plugins/colorpicker/images/custom_submit.png Binary files differnew file mode 100755 index 0000000..7bd51c0 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/custom_submit.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/select.png b/javascript/libs/jquery/plugins/colorpicker/images/select.png Binary files differnew file mode 100755 index 0000000..21213bf --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/select.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/select2.png b/javascript/libs/jquery/plugins/colorpicker/images/select2.png Binary files differnew file mode 100755 index 0000000..2cd2cab --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/select2.png diff --git a/javascript/libs/jquery/plugins/colorpicker/images/slider.png b/javascript/libs/jquery/plugins/colorpicker/images/slider.png Binary files differnew file mode 100755 index 0000000..8b03da9 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/images/slider.png diff --git a/javascript/libs/jquery/plugins/colorpicker/js/colorpicker.js b/javascript/libs/jquery/plugins/colorpicker/js/colorpicker.js new file mode 100755 index 0000000..10a2b22 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/js/colorpicker.js @@ -0,0 +1,484 @@ +/**
+ *
+ * Color picker
+ * Author: Stefan Petre www.eyecon.ro
+ *
+ * Dual licensed under the MIT and GPL licenses
+ *
+ */
+(function ($) {
+ var ColorPicker = function () {
+ var
+ ids = {},
+ inAction,
+ charMin = 65,
+ visible,
+ tpl = '<div class="colorpicker"><div class="colorpicker_color"><div><div></div></div></div><div class="colorpicker_hue"><div></div></div><div class="colorpicker_new_color"></div><div class="colorpicker_current_color"></div><div class="colorpicker_hex"><input type="text" maxlength="6" size="6" /></div><div class="colorpicker_rgb_r colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_g colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_rgb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_h colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_s colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_hsb_b colorpicker_field"><input type="text" maxlength="3" size="3" /><span></span></div><div class="colorpicker_submit"></div></div>',
+ defaults = {
+ eventName: 'click',
+ onShow: function () {},
+ onBeforeShow: function(){},
+ onHide: function () {},
+ onChange: function () {},
+ onSubmit: function () {},
+ color: 'ff0000',
+ livePreview: true,
+ flat: false
+ },
+ fillRGBFields = function (hsb, cal) {
+ var rgb = HSBToRGB(hsb);
+ $(cal).data('colorpicker').fields
+ .eq(1).val(rgb.r).end()
+ .eq(2).val(rgb.g).end()
+ .eq(3).val(rgb.b).end();
+ },
+ fillHSBFields = function (hsb, cal) {
+ $(cal).data('colorpicker').fields
+ .eq(4).val(hsb.h).end()
+ .eq(5).val(hsb.s).end()
+ .eq(6).val(hsb.b).end();
+ },
+ fillHexFields = function (hsb, cal) {
+ $(cal).data('colorpicker').fields
+ .eq(0).val(HSBToHex(hsb)).end();
+ },
+ setSelector = function (hsb, cal) {
+ $(cal).data('colorpicker').selector.css('backgroundColor', '#' + HSBToHex({h: hsb.h, s: 100, b: 100}));
+ $(cal).data('colorpicker').selectorIndic.css({
+ left: parseInt(150 * hsb.s/100, 10),
+ top: parseInt(150 * (100-hsb.b)/100, 10)
+ });
+ },
+ setHue = function (hsb, cal) {
+ $(cal).data('colorpicker').hue.css('top', parseInt(150 - 150 * hsb.h/360, 10));
+ },
+ setCurrentColor = function (hsb, cal) {
+ $(cal).data('colorpicker').currentColor.css('backgroundColor', '#' + HSBToHex(hsb));
+ },
+ setNewColor = function (hsb, cal) {
+ $(cal).data('colorpicker').newColor.css('backgroundColor', '#' + HSBToHex(hsb));
+ },
+ keyDown = function (ev) {
+ var pressedKey = ev.charCode || ev.keyCode || -1;
+ if ((pressedKey > charMin && pressedKey <= 90) || pressedKey == 32) {
+ return false;
+ }
+ var cal = $(this).parent().parent();
+ if (cal.data('colorpicker').livePreview === true) {
+ change.apply(this);
+ }
+ },
+ change = function (ev) {
+ var cal = $(this).parent().parent(), col;
+ if (this.parentNode.className.indexOf('_hex') > 0) {
+ cal.data('colorpicker').color = col = HexToHSB(fixHex(this.value));
+ } else if (this.parentNode.className.indexOf('_hsb') > 0) {
+ cal.data('colorpicker').color = col = fixHSB({
+ h: parseInt(cal.data('colorpicker').fields.eq(4).val(), 10),
+ s: parseInt(cal.data('colorpicker').fields.eq(5).val(), 10),
+ b: parseInt(cal.data('colorpicker').fields.eq(6).val(), 10)
+ });
+ } else {
+ cal.data('colorpicker').color = col = RGBToHSB(fixRGB({
+ r: parseInt(cal.data('colorpicker').fields.eq(1).val(), 10),
+ g: parseInt(cal.data('colorpicker').fields.eq(2).val(), 10),
+ b: parseInt(cal.data('colorpicker').fields.eq(3).val(), 10)
+ }));
+ }
+ if (ev) {
+ fillRGBFields(col, cal.get(0));
+ fillHexFields(col, cal.get(0));
+ fillHSBFields(col, cal.get(0));
+ }
+ setSelector(col, cal.get(0));
+ setHue(col, cal.get(0));
+ setNewColor(col, cal.get(0));
+ cal.data('colorpicker').onChange.apply(cal, [col, HSBToHex(col), HSBToRGB(col)]);
+ },
+ blur = function (ev) {
+ var cal = $(this).parent().parent();
+ cal.data('colorpicker').fields.parent().removeClass('colorpicker_focus');
+ },
+ focus = function () {
+ charMin = this.parentNode.className.indexOf('_hex') > 0 ? 70 : 65;
+ $(this).parent().parent().data('colorpicker').fields.parent().removeClass('colorpicker_focus');
+ $(this).parent().addClass('colorpicker_focus');
+ },
+ downIncrement = function (ev) {
+ var field = $(this).parent().find('input').focus();
+ var current = {
+ el: $(this).parent().addClass('colorpicker_slider'),
+ max: this.parentNode.className.indexOf('_hsb_h') > 0 ? 360 : (this.parentNode.className.indexOf('_hsb') > 0 ? 100 : 255),
+ y: ev.pageY,
+ field: field,
+ val: parseInt(field.val(), 10),
+ preview: $(this).parent().parent().data('colorpicker').livePreview
+ };
+ $(document).bind('mouseup', current, upIncrement);
+ $(document).bind('mousemove', current, moveIncrement);
+ },
+ moveIncrement = function (ev) {
+ ev.data.field.val(Math.max(0, Math.min(ev.data.max, parseInt(ev.data.val + ev.pageY - ev.data.y, 10))));
+ if (ev.data.preview) {
+ change.apply(ev.data.field.get(0), [true]);
+ }
+ return false;
+ },
+ upIncrement = function (ev) {
+ change.apply(ev.data.field.get(0), [true]);
+ ev.data.el.removeClass('colorpicker_slider').find('input').focus();
+ $(document).unbind('mouseup', upIncrement);
+ $(document).unbind('mousemove', moveIncrement);
+ return false;
+ },
+ downHue = function (ev) {
+ var current = {
+ cal: $(this).parent(),
+ y: $(this).offset().top
+ };
+ current.preview = current.cal.data('colorpicker').livePreview;
+ $(document).bind('mouseup', current, upHue);
+ $(document).bind('mousemove', current, moveHue);
+ },
+ moveHue = function (ev) {
+ change.apply(
+ ev.data.cal.data('colorpicker')
+ .fields
+ .eq(4)
+ .val(parseInt(360*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.y))))/150, 10))
+ .get(0),
+ [ev.data.preview]
+ );
+ return false;
+ },
+ upHue = function (ev) {
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+ $(document).unbind('mouseup', upHue);
+ $(document).unbind('mousemove', moveHue);
+ return false;
+ },
+ downSelector = function (ev) {
+ var current = {
+ cal: $(this).parent(),
+ pos: $(this).offset()
+ };
+ current.preview = current.cal.data('colorpicker').livePreview;
+ $(document).bind('mouseup', current, upSelector);
+ $(document).bind('mousemove', current, moveSelector);
+ },
+ moveSelector = function (ev) {
+ change.apply(
+ ev.data.cal.data('colorpicker')
+ .fields
+ .eq(6)
+ .val(parseInt(100*(150 - Math.max(0,Math.min(150,(ev.pageY - ev.data.pos.top))))/150, 10))
+ .end()
+ .eq(5)
+ .val(parseInt(100*(Math.max(0,Math.min(150,(ev.pageX - ev.data.pos.left))))/150, 10))
+ .get(0),
+ [ev.data.preview]
+ );
+ return false;
+ },
+ upSelector = function (ev) {
+ fillRGBFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+ fillHexFields(ev.data.cal.data('colorpicker').color, ev.data.cal.get(0));
+ $(document).unbind('mouseup', upSelector);
+ $(document).unbind('mousemove', moveSelector);
+ return false;
+ },
+ enterSubmit = function (ev) {
+ $(this).addClass('colorpicker_focus');
+ },
+ leaveSubmit = function (ev) {
+ $(this).removeClass('colorpicker_focus');
+ },
+ clickSubmit = function (ev) {
+ var cal = $(this).parent();
+ var col = cal.data('colorpicker').color;
+ cal.data('colorpicker').origColor = col;
+ setCurrentColor(col, cal.get(0));
+ cal.data('colorpicker').onSubmit(col, HSBToHex(col), HSBToRGB(col), cal.data('colorpicker').el);
+ },
+ show = function (ev) {
+ var cal = $('#' + $(this).data('colorpickerId'));
+ cal.data('colorpicker').onBeforeShow.apply(this, [cal.get(0)]);
+ var pos = $(this).offset();
+ var viewPort = getViewport();
+ var top = pos.top + this.offsetHeight;
+ var left = pos.left;
+ if (top + 176 > viewPort.t + viewPort.h) {
+ top -= this.offsetHeight + 176;
+ }
+ if (left + 356 > viewPort.l + viewPort.w) {
+ left -= 356;
+ }
+ cal.css({left: left + 'px', top: top + 'px'});
+ if (cal.data('colorpicker').onShow.apply(this, [cal.get(0)]) != false) {
+ cal.show();
+ }
+ $(document).bind('mousedown', {cal: cal}, hide);
+ return false;
+ },
+ hide = function (ev) {
+ if (!isChildOf(ev.data.cal.get(0), ev.target, ev.data.cal.get(0))) {
+ if (ev.data.cal.data('colorpicker').onHide.apply(this, [ev.data.cal.get(0)]) != false) {
+ ev.data.cal.hide();
+ }
+ $(document).unbind('mousedown', hide);
+ }
+ },
+ isChildOf = function(parentEl, el, container) {
+ if (parentEl == el) {
+ return true;
+ }
+ if (parentEl.contains) {
+ return parentEl.contains(el);
+ }
+ if ( parentEl.compareDocumentPosition ) {
+ return !!(parentEl.compareDocumentPosition(el) & 16);
+ }
+ var prEl = el.parentNode;
+ while(prEl && prEl != container) {
+ if (prEl == parentEl)
+ return true;
+ prEl = prEl.parentNode;
+ }
+ return false;
+ },
+ getViewport = function () {
+ var m = document.compatMode == 'CSS1Compat';
+ return {
+ l : window.pageXOffset || (m ? document.documentElement.scrollLeft : document.body.scrollLeft),
+ t : window.pageYOffset || (m ? document.documentElement.scrollTop : document.body.scrollTop),
+ w : window.innerWidth || (m ? document.documentElement.clientWidth : document.body.clientWidth),
+ h : window.innerHeight || (m ? document.documentElement.clientHeight : document.body.clientHeight)
+ };
+ },
+ fixHSB = function (hsb) {
+ return {
+ h: Math.min(360, Math.max(0, hsb.h)),
+ s: Math.min(100, Math.max(0, hsb.s)),
+ b: Math.min(100, Math.max(0, hsb.b))
+ };
+ },
+ fixRGB = function (rgb) {
+ return {
+ r: Math.min(255, Math.max(0, rgb.r)),
+ g: Math.min(255, Math.max(0, rgb.g)),
+ b: Math.min(255, Math.max(0, rgb.b))
+ };
+ },
+ fixHex = function (hex) {
+ var len = 6 - hex.length;
+ if (len > 0) {
+ var o = [];
+ for (var i=0; i<len; i++) {
+ o.push('0');
+ }
+ o.push(hex);
+ hex = o.join('');
+ }
+ return hex;
+ },
+ HexToRGB = function (hex) {
+ var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
+ return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
+ },
+ HexToHSB = function (hex) {
+ return RGBToHSB(HexToRGB(hex));
+ },
+ RGBToHSB = function (rgb) {
+ var hsb = {
+ h: 0,
+ s: 0,
+ b: 0
+ };
+ var min = Math.min(rgb.r, rgb.g, rgb.b);
+ var max = Math.max(rgb.r, rgb.g, rgb.b);
+ var delta = max - min;
+ hsb.b = max;
+ if (max != 0) {
+
+ }
+ hsb.s = max != 0 ? 255 * delta / max : 0;
+ if (hsb.s != 0) {
+ if (rgb.r == max) {
+ hsb.h = (rgb.g - rgb.b) / delta;
+ } else if (rgb.g == max) {
+ hsb.h = 2 + (rgb.b - rgb.r) / delta;
+ } else {
+ hsb.h = 4 + (rgb.r - rgb.g) / delta;
+ }
+ } else {
+ hsb.h = -1;
+ }
+ hsb.h *= 60;
+ if (hsb.h < 0) {
+ hsb.h += 360;
+ }
+ hsb.s *= 100/255;
+ hsb.b *= 100/255;
+ return hsb;
+ },
+ HSBToRGB = function (hsb) {
+ var rgb = {};
+ var h = Math.round(hsb.h);
+ var s = Math.round(hsb.s*255/100);
+ var v = Math.round(hsb.b*255/100);
+ if(s == 0) {
+ rgb.r = rgb.g = rgb.b = v;
+ } else {
+ var t1 = v;
+ var t2 = (255-s)*v/255;
+ var t3 = (t1-t2)*(h%60)/60;
+ if(h==360) h = 0;
+ if(h<60) {rgb.r=t1; rgb.b=t2; rgb.g=t2+t3}
+ else if(h<120) {rgb.g=t1; rgb.b=t2; rgb.r=t1-t3}
+ else if(h<180) {rgb.g=t1; rgb.r=t2; rgb.b=t2+t3}
+ else if(h<240) {rgb.b=t1; rgb.r=t2; rgb.g=t1-t3}
+ else if(h<300) {rgb.b=t1; rgb.g=t2; rgb.r=t2+t3}
+ else if(h<360) {rgb.r=t1; rgb.g=t2; rgb.b=t1-t3}
+ else {rgb.r=0; rgb.g=0; rgb.b=0}
+ }
+ return {r:Math.round(rgb.r), g:Math.round(rgb.g), b:Math.round(rgb.b)};
+ },
+ RGBToHex = function (rgb) {
+ var hex = [
+ rgb.r.toString(16),
+ rgb.g.toString(16),
+ rgb.b.toString(16)
+ ];
+ $.each(hex, function (nr, val) {
+ if (val.length == 1) {
+ hex[nr] = '0' + val;
+ }
+ });
+ return hex.join('');
+ },
+ HSBToHex = function (hsb) {
+ return RGBToHex(HSBToRGB(hsb));
+ },
+ restoreOriginal = function () {
+ var cal = $(this).parent();
+ var col = cal.data('colorpicker').origColor;
+ cal.data('colorpicker').color = col;
+ fillRGBFields(col, cal.get(0));
+ fillHexFields(col, cal.get(0));
+ fillHSBFields(col, cal.get(0));
+ setSelector(col, cal.get(0));
+ setHue(col, cal.get(0));
+ setNewColor(col, cal.get(0));
+ };
+ return {
+ init: function (opt) {
+ opt = $.extend({}, defaults, opt||{});
+ if (typeof opt.color == 'string') {
+ opt.color = HexToHSB(opt.color);
+ } else if (opt.color.r != undefined && opt.color.g != undefined && opt.color.b != undefined) {
+ opt.color = RGBToHSB(opt.color);
+ } else if (opt.color.h != undefined && opt.color.s != undefined && opt.color.b != undefined) {
+ opt.color = fixHSB(opt.color);
+ } else {
+ return this;
+ }
+ return this.each(function () {
+ if (!$(this).data('colorpickerId')) {
+ var options = $.extend({}, opt);
+ options.origColor = opt.color;
+ var id = 'collorpicker_' + parseInt(Math.random() * 1000);
+ $(this).data('colorpickerId', id);
+ var cal = $(tpl).attr('id', id);
+ if (options.flat) {
+ cal.appendTo(this).show();
+ } else {
+ cal.appendTo(document.body);
+ }
+ options.fields = cal
+ .find('input')
+ .bind('keyup', keyDown)
+ .bind('change', change)
+ .bind('blur', blur)
+ .bind('focus', focus);
+ cal
+ .find('span').bind('mousedown', downIncrement).end()
+ .find('>div.colorpicker_current_color').bind('click', restoreOriginal);
+ options.selector = cal.find('div.colorpicker_color').bind('mousedown', downSelector);
+ options.selectorIndic = options.selector.find('div div');
+ options.el = this;
+ options.hue = cal.find('div.colorpicker_hue div');
+ cal.find('div.colorpicker_hue').bind('mousedown', downHue);
+ options.newColor = cal.find('div.colorpicker_new_color');
+ options.currentColor = cal.find('div.colorpicker_current_color');
+ cal.data('colorpicker', options);
+ cal.find('div.colorpicker_submit')
+ .bind('mouseenter', enterSubmit)
+ .bind('mouseleave', leaveSubmit)
+ .bind('click', clickSubmit);
+ fillRGBFields(options.color, cal.get(0));
+ fillHSBFields(options.color, cal.get(0));
+ fillHexFields(options.color, cal.get(0));
+ setHue(options.color, cal.get(0));
+ setSelector(options.color, cal.get(0));
+ setCurrentColor(options.color, cal.get(0));
+ setNewColor(options.color, cal.get(0));
+ if (options.flat) {
+ cal.css({
+ position: 'relative',
+ display: 'block'
+ });
+ } else {
+ $(this).bind(options.eventName, show);
+ }
+ }
+ });
+ },
+ showPicker: function() {
+ return this.each( function () {
+ if ($(this).data('colorpickerId')) {
+ show.apply(this);
+ }
+ });
+ },
+ hidePicker: function() {
+ return this.each( function () {
+ if ($(this).data('colorpickerId')) {
+ $('#' + $(this).data('colorpickerId')).hide();
+ }
+ });
+ },
+ setColor: function(col) {
+ if (typeof col == 'string') {
+ col = HexToHSB(col);
+ } else if (col.r != undefined && col.g != undefined && col.b != undefined) {
+ col = RGBToHSB(col);
+ } else if (col.h != undefined && col.s != undefined && col.b != undefined) {
+ col = fixHSB(col);
+ } else {
+ return this;
+ }
+ return this.each(function(){
+ if ($(this).data('colorpickerId')) {
+ var cal = $('#' + $(this).data('colorpickerId'));
+ cal.data('colorpicker').color = col;
+ cal.data('colorpicker').origColor = col;
+ fillRGBFields(col, cal.get(0));
+ fillHSBFields(col, cal.get(0));
+ fillHexFields(col, cal.get(0));
+ setHue(col, cal.get(0));
+ setSelector(col, cal.get(0));
+ setCurrentColor(col, cal.get(0));
+ setNewColor(col, cal.get(0));
+ }
+ });
+ }
+ };
+ }();
+ $.fn.extend({
+ ColorPicker: ColorPicker.init,
+ ColorPickerHide: ColorPicker.hidePicker,
+ ColorPickerShow: ColorPicker.showPicker,
+ ColorPickerSetColor: ColorPicker.setColor
+ });
+})(jQuery)
\ No newline at end of file diff --git a/javascript/libs/jquery/plugins/colorpicker/js/eye.js b/javascript/libs/jquery/plugins/colorpicker/js/eye.js new file mode 100755 index 0000000..ea70e64 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/js/eye.js @@ -0,0 +1,34 @@ +/**
+ *
+ * Zoomimage
+ * Author: Stefan Petre www.eyecon.ro
+ *
+ */
+(function($){
+ var EYE = window.EYE = function() {
+ var _registered = {
+ init: []
+ };
+ return {
+ init: function() {
+ $.each(_registered.init, function(nr, fn){
+ fn.call();
+ });
+ },
+ extend: function(prop) {
+ for (var i in prop) {
+ if (prop[i] != undefined) {
+ this[i] = prop[i];
+ }
+ }
+ },
+ register: function(fn, type) {
+ if (!_registered[type]) {
+ _registered[type] = [];
+ }
+ _registered[type].push(fn);
+ }
+ };
+ }();
+ $(EYE.init);
+})(jQuery);
diff --git a/javascript/libs/jquery/plugins/colorpicker/js/layout.js b/javascript/libs/jquery/plugins/colorpicker/js/layout.js new file mode 100755 index 0000000..e0dfb8f --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/js/layout.js @@ -0,0 +1,67 @@ +(function($){
+ var initLayout = function() {
+ var hash = window.location.hash.replace('#', '');
+ var currentTab = $('ul.navigationTabs a')
+ .bind('click', showTab)
+ .filter('a[rel=' + hash + ']');
+ if (currentTab.size() == 0) {
+ currentTab = $('ul.navigationTabs a:first');
+ }
+ showTab.apply(currentTab.get(0));
+ $('#colorpickerHolder').ColorPicker({flat: true});
+ $('#colorpickerHolder2').ColorPicker({
+ flat: true,
+ color: '#00ff00',
+ onSubmit: function(hsb, hex, rgb) {
+ $('#colorSelector2 div').css('backgroundColor', '#' + hex);
+ }
+ });
+ $('#colorpickerHolder2>div').css('position', 'absolute');
+ var widt = false;
+ $('#colorSelector2').bind('click', function() {
+ $('#colorpickerHolder2').stop().animate({height: widt ? 0 : 173}, 500);
+ widt = !widt;
+ });
+ $('#colorpickerField1, #colorpickerField2, #colorpickerField3').ColorPicker({
+ onSubmit: function(hsb, hex, rgb, el) {
+ $(el).val(hex);
+ $(el).ColorPickerHide();
+ },
+ onBeforeShow: function () {
+ $(this).ColorPickerSetColor(this.value);
+ }
+ })
+ .bind('keyup', function(){
+ $(this).ColorPickerSetColor(this.value);
+ });
+ $('#colorSelector').ColorPicker({
+ color: '#0000ff',
+ onShow: function (colpkr) {
+ $(colpkr).fadeIn(500);
+ return false;
+ },
+ onHide: function (colpkr) {
+ $(colpkr).fadeOut(500);
+ return false;
+ },
+ onChange: function (hsb, hex, rgb) {
+ $('#colorSelector div').css('backgroundColor', '#' + hex);
+ }
+ });
+ };
+
+ var showTab = function(e) {
+ var tabIndex = $('ul.navigationTabs a')
+ .removeClass('active')
+ .index(this);
+ $(this)
+ .addClass('active')
+ .blur();
+ $('div.tab')
+ .hide()
+ .eq(tabIndex)
+ .show();
+ };
+
+ EYE.register(initLayout, 'init');
+})(jQuery)
\ No newline at end of file diff --git a/javascript/libs/jquery/plugins/colorpicker/js/utils.js b/javascript/libs/jquery/plugins/colorpicker/js/utils.js new file mode 100755 index 0000000..cc7ce14 --- /dev/null +++ b/javascript/libs/jquery/plugins/colorpicker/js/utils.js @@ -0,0 +1,252 @@ +/**
+ *
+ * Utilities
+ * Author: Stefan Petre www.eyecon.ro
+ *
+ */
+(function($) {
+EYE.extend({
+ getPosition : function(e, forceIt)
+ {
+ var x = 0;
+ var y = 0;
+ var es = e.style;
+ var restoreStyles = false;
+ if (forceIt && jQuery.curCSS(e,'display') == 'none') {
+ var oldVisibility = es.visibility;
+ var oldPosition = es.position;
+ restoreStyles = true;
+ es.visibility = 'hidden';
+ es.display = 'block';
+ es.position = 'absolute';
+ }
+ var el = e;
+ if (el.getBoundingClientRect) { // IE
+ var box = el.getBoundingClientRect();
+ x = box.left + Math.max(document.documentElement.scrollLeft, document.body.scrollLeft) - 2;
+ y = box.top + Math.max(document.documentElement.scrollTop, document.body.scrollTop) - 2;
+ } else {
+ x = el.offsetLeft;
+ y = el.offsetTop;
+ el = el.offsetParent;
+ if (e != el) {
+ while (el) {
+ x += el.offsetLeft;
+ y += el.offsetTop;
+ el = el.offsetParent;
+ }
+ }
+ if (jQuery.browser.safari && jQuery.curCSS(e, 'position') == 'absolute' ) {
+ x -= document.body.offsetLeft;
+ y -= document.body.offsetTop;
+ }
+ el = e.parentNode;
+ while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
+ {
+ if (jQuery.curCSS(el, 'display') != 'inline') {
+ x -= el.scrollLeft;
+ y -= el.scrollTop;
+ }
+ el = el.parentNode;
+ }
+ }
+ if (restoreStyles == true) {
+ es.display = 'none';
+ es.position = oldPosition;
+ es.visibility = oldVisibility;
+ }
+ return {x:x, y:y};
+ },
+ getSize : function(e)
+ {
+ var w = parseInt(jQuery.curCSS(e,'width'), 10);
+ var h = parseInt(jQuery.curCSS(e,'height'), 10);
+ var wb = 0;
+ var hb = 0;
+ if (jQuery.curCSS(e, 'display') != 'none') {
+ wb = e.offsetWidth;
+ hb = e.offsetHeight;
+ } else {
+ var es = e.style;
+ var oldVisibility = es.visibility;
+ var oldPosition = es.position;
+ es.visibility = 'hidden';
+ es.display = 'block';
+ es.position = 'absolute';
+ wb = e.offsetWidth;
+ hb = e.offsetHeight;
+ es.display = 'none';
+ es.position = oldPosition;
+ es.visibility = oldVisibility;
+ }
+ return {w:w, h:h, wb:wb, hb:hb};
+ },
+ getClient : function(e)
+ {
+ var h, w;
+ if (e) {
+ w = e.clientWidth;
+ h = e.clientHeight;
+ } else {
+ var de = document.documentElement;
+ w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
+ h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
+ }
+ return {w:w,h:h};
+ },
+ getScroll : function (e)
+ {
+ var t=0, l=0, w=0, h=0, iw=0, ih=0;
+ if (e && e.nodeName.toLowerCase() != 'body') {
+ t = e.scrollTop;
+ l = e.scrollLeft;
+ w = e.scrollWidth;
+ h = e.scrollHeight;
+ } else {
+ if (document.documentElement) {
+ t = document.documentElement.scrollTop;
+ l = document.documentElement.scrollLeft;
+ w = document.documentElement.scrollWidth;
+ h = document.documentElement.scrollHeight;
+ } else if (document.body) {
+ t = document.body.scrollTop;
+ l = document.body.scrollLeft;
+ w = document.body.scrollWidth;
+ h = document.body.scrollHeight;
+ }
+ if (typeof pageYOffset != 'undefined') {
+ t = pageYOffset;
+ l = pageXOffset;
+ }
+ iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
+ ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
+ }
+ return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
+ },
+ getMargins : function(e, toInteger)
+ {
+ var t = jQuery.curCSS(e,'marginTop') || '';
+ var r = jQuery.curCSS(e,'marginRight') || '';
+ var b = jQuery.curCSS(e,'marginBottom') || '';
+ var l = jQuery.curCSS(e,'marginLeft') || '';
+ if (toInteger)
+ return {
+ t: parseInt(t, 10)||0,
+ r: parseInt(r, 10)||0,
+ b: parseInt(b, 10)||0,
+ l: parseInt(l, 10)
+ };
+ else
+ return {t: t, r: r, b: b, l: l};
+ },
+ getPadding : function(e, toInteger)
+ {
+ var t = jQuery.curCSS(e,'paddingTop') || '';
+ var r = jQuery.curCSS(e,'paddingRight') || '';
+ var b = jQuery.curCSS(e,'paddingBottom') || '';
+ var l = jQuery.curCSS(e,'paddingLeft') || '';
+ if (toInteger)
+ return {
+ t: parseInt(t, 10)||0,
+ r: parseInt(r, 10)||0,
+ b: parseInt(b, 10)||0,
+ l: parseInt(l, 10)
+ };
+ else
+ return {t: t, r: r, b: b, l: l};
+ },
+ getBorder : function(e, toInteger)
+ {
+ var t = jQuery.curCSS(e,'borderTopWidth') || '';
+ var r = jQuery.curCSS(e,'borderRightWidth') || '';
+ var b = jQuery.curCSS(e,'borderBottomWidth') || '';
+ var l = jQuery.curCSS(e,'borderLeftWidth') || '';
+ if (toInteger)
+ return {
+ t: parseInt(t, 10)||0,
+ r: parseInt(r, 10)||0,
+ b: parseInt(b, 10)||0,
+ l: parseInt(l, 10)||0
+ };
+ else
+ return {t: t, r: r, b: b, l: l};
+ },
+ traverseDOM : function(nodeEl, func)
+ {
+ func(nodeEl);
+ nodeEl = nodeEl.firstChild;
+ while(nodeEl){
+ EYE.traverseDOM(nodeEl, func);
+ nodeEl = nodeEl.nextSibling;
+ }
+ },
+ getInnerWidth : function(el, scroll) {
+ var offsetW = el.offsetWidth;
+ return scroll ? Math.max(el.scrollWidth,offsetW) - offsetW + el.clientWidth:el.clientWidth;
+ },
+ getInnerHeight : function(el, scroll) {
+ var offsetH = el.offsetHeight;
+ return scroll ? Math.max(el.scrollHeight,offsetH) - offsetH + el.clientHeight:el.clientHeight;
+ },
+ getExtraWidth : function(el) {
+ if($.boxModel)
+ return (parseInt($.curCSS(el, 'paddingLeft'))||0)
+ + (parseInt($.curCSS(el, 'paddingRight'))||0)
+ + (parseInt($.curCSS(el, 'borderLeftWidth'))||0)
+ + (parseInt($.curCSS(el, 'borderRightWidth'))||0);
+ return 0;
+ },
+ getExtraHeight : function(el) {
+ if($.boxModel)
+ return (parseInt($.curCSS(el, 'paddingTop'))||0)
+ + (parseInt($.curCSS(el, 'paddingBottom'))||0)
+ + (parseInt($.curCSS(el, 'borderTopWidth'))||0)
+ + (parseInt($.curCSS(el, 'borderBottomWidth'))||0);
+ return 0;
+ },
+ isChildOf: function(parentEl, el, container) {
+ if (parentEl == el) {
+ return true;
+ }
+ if (!el || !el.nodeType || el.nodeType != 1) {
+ return false;
+ }
+ if (parentEl.contains && !$.browser.safari) {
+ return parentEl.contains(el);
+ }
+ if ( parentEl.compareDocumentPosition ) {
+ return !!(parentEl.compareDocumentPosition(el) & 16);
+ }
+ var prEl = el.parentNode;
+ while(prEl && prEl != container) {
+ if (prEl == parentEl)
+ return true;
+ prEl = prEl.parentNode;
+ }
+ return false;
+ },
+ centerEl : function(el, axis)
+ {
+ var clientScroll = EYE.getScroll();
+ var size = EYE.getSize(el);
+ if (!axis || axis == 'vertically')
+ $(el).css(
+ {
+ top: clientScroll.t + ((Math.min(clientScroll.h,clientScroll.ih) - size.hb)/2) + 'px'
+ }
+ );
+ if (!axis || axis == 'horizontally')
+ $(el).css(
+ {
+ left: clientScroll.l + ((Math.min(clientScroll.w,clientScroll.iw) - size.wb)/2) + 'px'
+ }
+ );
+ }
+});
+if (!$.easing.easeout) {
+ $.easing.easeout = function(p, n, firstNum, delta, duration) {
+ return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
+ };
+}
+
+})(jQuery);
\ No newline at end of file |
