updating included jquery plugins

This commit is contained in:
Ben Word
2011-07-31 01:46:50 -06:00
parent 0d537df73e
commit 1d8f643729
5 changed files with 1703 additions and 27 deletions

1483
js/jquery.cycle.all.js Normal file

File diff suppressed because it is too large Load Diff

218
js/jquery.cycle.lite.js Normal file
View File

@@ -0,0 +1,218 @@
/*
* jQuery Cycle Lite Plugin
* http://malsup.com/jquery/cycle/lite/
* Copyright (c) 2008-2011 M. Alsup
* Version: 1.3 (01-JUN-2011)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.3.2 or later
*/
;(function($) {
var ver = 'Lite-1.3';
$.fn.cycle = function(options) {
return this.each(function() {
options = options || {};
if (this.cycleTimeout) clearTimeout(this.cycleTimeout);
this.cycleTimeout = 0;
this.cyclePause = 0;
var $cont = $(this);
var $slides = options.slideExpr ? $(options.slideExpr, this) : $cont.children();
var els = $slides.get();
if (els.length < 2) {
window.console && console.log('terminating; too few slides: ' + els.length);
return; // don't bother
}
// support metadata plugin (v1.0 and v2.0)
var opts = $.extend({}, $.fn.cycle.defaults, options || {}, $.metadata ? $cont.metadata() : $.meta ? $cont.data() : {});
var meta = $.isFunction($cont.data) ? $cont.data(opts.metaAttr) : null;
if (meta)
opts = $.extend(opts, meta);
opts.before = opts.before ? [opts.before] : [];
opts.after = opts.after ? [opts.after] : [];
opts.after.unshift(function(){ opts.busy=0; });
// allow shorthand overrides of width, height and timeout
var cls = this.className;
opts.width = parseInt((cls.match(/w:(\d+)/)||[])[1]) || opts.width;
opts.height = parseInt((cls.match(/h:(\d+)/)||[])[1]) || opts.height;
opts.timeout = parseInt((cls.match(/t:(\d+)/)||[])[1]) || opts.timeout;
if ($cont.css('position') == 'static')
$cont.css('position', 'relative');
if (opts.width)
$cont.width(opts.width);
if (opts.height && opts.height != 'auto')
$cont.height(opts.height);
var first = 0;
$slides.css({position: 'absolute', top:0, left:0}).each(function(i) {
$(this).css('z-index', els.length-i)
});
$(els[first]).css('opacity',1).show(); // opacity bit needed to handle reinit case
if ($.browser.msie) els[first].style.removeAttribute('filter');
if (opts.fit && opts.width)
$slides.width(opts.width);
if (opts.fit && opts.height && opts.height != 'auto')
$slides.height(opts.height);
if (opts.pause)
$cont.hover(function(){this.cyclePause=1;}, function(){this.cyclePause=0;});
var txFn = $.fn.cycle.transitions[opts.fx];
txFn && txFn($cont, $slides, opts);
$slides.each(function() {
var $el = $(this);
this.cycleH = (opts.fit && opts.height) ? opts.height : $el.height();
this.cycleW = (opts.fit && opts.width) ? opts.width : $el.width();
});
if (opts.cssFirst)
$($slides[first]).css(opts.cssFirst);
if (opts.timeout) {
// ensure that timeout and speed settings are sane
if (opts.speed.constructor == String)
opts.speed = {slow: 600, fast: 200}[opts.speed] || 400;
if (!opts.sync)
opts.speed = opts.speed / 2;
while((opts.timeout - opts.speed) < 250)
opts.timeout += opts.speed;
}
opts.speedIn = opts.speed;
opts.speedOut = opts.speed;
opts.slideCount = els.length;
opts.currSlide = first;
opts.nextSlide = 1;
// fire artificial events
var e0 = $slides[first];
if (opts.before.length)
opts.before[0].apply(e0, [e0, e0, opts, true]);
if (opts.after.length > 1)
opts.after[1].apply(e0, [e0, e0, opts, true]);
if (opts.click && !opts.next)
opts.next = opts.click;
if (opts.next)
$(opts.next).bind('click', function(){return advance(els,opts,opts.rev?-1:1)});
if (opts.prev)
$(opts.prev).bind('click', function(){return advance(els,opts,opts.rev?1:-1)});
if (opts.timeout)
this.cycleTimeout = setTimeout(function() {
go(els,opts,0,!opts.rev)
}, opts.timeout + (opts.delay||0));
});
};
function go(els, opts, manual, fwd) {
if (opts.busy) return;
var p = els[0].parentNode, curr = els[opts.currSlide], next = els[opts.nextSlide];
if (p.cycleTimeout === 0 && !manual)
return;
if (manual || !p.cyclePause) {
if (opts.before.length)
$.each(opts.before, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
var after = function() {
if ($.browser.msie)
this.style.removeAttribute('filter');
$.each(opts.after, function(i,o) { o.apply(next, [curr, next, opts, fwd]); });
};
if (opts.nextSlide != opts.currSlide) {
opts.busy = 1;
$.fn.cycle.custom(curr, next, opts, after);
}
var roll = (opts.nextSlide + 1) == els.length;
opts.nextSlide = roll ? 0 : opts.nextSlide+1;
opts.currSlide = roll ? els.length-1 : opts.nextSlide-1;
}
if (opts.timeout)
p.cycleTimeout = setTimeout(function() { go(els,opts,0,!opts.rev) }, opts.timeout);
};
// advance slide forward or back
function advance(els, opts, val) {
var p = els[0].parentNode, timeout = p.cycleTimeout;
if (timeout) {
clearTimeout(timeout);
p.cycleTimeout = 0;
}
opts.nextSlide = opts.currSlide + val;
if (opts.nextSlide < 0) {
opts.nextSlide = els.length - 1;
}
else if (opts.nextSlide >= els.length) {
opts.nextSlide = 0;
}
go(els, opts, 1, val>=0);
return false;
};
$.fn.cycle.custom = function(curr, next, opts, cb) {
var $l = $(curr), $n = $(next);
$n.css(opts.cssBefore);
var fn = function() {$n.animate(opts.animIn, opts.speedIn, opts.easeIn, cb)};
$l.animate(opts.animOut, opts.speedOut, opts.easeOut, function() {
$l.css(opts.cssAfter);
if (!opts.sync) fn();
});
if (opts.sync) fn();
};
$.fn.cycle.transitions = {
fade: function($cont, $slides, opts) {
$slides.not(':eq(0)').hide();
opts.cssBefore = { opacity: 0, display: 'block' };
opts.cssAfter = { display: 'none' };
opts.animOut = { opacity: 0 };
opts.animIn = { opacity: 1 };
},
fadeout: function($cont, $slides, opts) {
opts.before.push(function(curr,next,opts,fwd) {
$(curr).css('zIndex',opts.slideCount + (fwd === true ? 1 : 0));
$(next).css('zIndex',opts.slideCount + (fwd === true ? 0 : 1));
});
$slides.not(':eq(0)').hide();
opts.cssBefore = { opacity: 1, display: 'block', zIndex: 1 };
opts.cssAfter = { display: 'none', zIndex: 0 };
opts.animOut = { opacity: 0 };
}
};
$.fn.cycle.ver = function() { return ver; };
// @see: http://malsup.com/jquery/cycle/lite/
$.fn.cycle.defaults = {
animIn: {},
animOut: {},
fx: 'fade',
after: null,
before: null,
cssBefore: {},
cssAfter: {},
delay: 0,
fit: 0,
height: 'auto',
metaAttr: 'cycle',
next: null,
pause: 0,
prev: null,
speed: 1000,
slideExpr: null,
sync: 1,
timeout: 4000
};
})(jQuery);

View File

@@ -1,11 +0,0 @@
/*
* jQuery Cycle Lite Plugin
* http://malsup.com/jquery/cycle/lite/
* Copyright (c) 2008-2011 M. Alsup
* Version: 1.1 (03/07/2011)
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
* Requires: jQuery v1.3.2 or later
*/
;(function($){var ver="Lite-1.1";$.fn.cycle=function(options){return this.each(function(){options=options||{};if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){window.console&&console.log("terminating; too few slides: "+els.length);return ;}var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});var cls=this.className;opts.width=parseInt((cls.match(/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(/t:(\d+)/)||[])[1])||opts.timeout;if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}var first=0;$slides.css({position:"absolute",top:0,left:0}).each(function(i){$(this).css("z-index",els.length-i);});$(els[first]).css("opacity",1).show();if($.browser.msie){els[first].style.removeAttribute("filter");}if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}if(opts.pause){$cont.hover(function(){this.cyclePause=1;},function(){this.cyclePause=0;});}var txFn=$.fn.cycle.transitions[opts.fx];txFn&&txFn($cont,$slides,opts);$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:$el.height();this.cycleW=(opts.fit&&opts.width)?opts.width:$el.width();});if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){if(opts.speed.constructor==String){opts.speed={slow:600,fast:200}[opts.speed]||400;}if(!opts.sync){opts.speed=opts.speed/2;}while((opts.timeout-opts.speed)<250){opts.timeout+=opts.speed;}}opts.speedIn=opts.speed;opts.speedOut=opts.speed;opts.slideCount=els.length;opts.currSlide=first;opts.nextSlide=1;var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.click&&!opts.next){opts.next=opts.click;}if(opts.next){$(opts.next).bind("click",function(){return advance(els,opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind("click",function(){return advance(els,opts,opts.rev?1:-1);});}if(opts.timeout){this.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},opts.timeout+(opts.delay||0));}});};function go(els,opts,manual,fwd){if(opts.busy){return ;}var p=els[0].parentNode,curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleTimeout===0&&!manual){return ;}if(manual||!p.cyclePause){if(opts.before.length){$.each(opts.before,function(i,o){o.apply(next,[curr,next,opts,fwd]);});}var after=function(){if($.browser.msie){this.style.removeAttribute("filter");}$.each(opts.after,function(i,o){o.apply(next,[curr,next,opts,fwd]);});};if(opts.nextSlide!=opts.currSlide){opts.busy=1;$.fn.cycle.custom(curr,next,opts,after);}var roll=(opts.nextSlide+1)==els.length;opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}if(opts.timeout){p.cycleTimeout=setTimeout(function(){go(els,opts,0,!opts.rev);},opts.timeout);}}function advance(els,opts,val){var p=els[0].parentNode,timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){opts.nextSlide=0;}}go(els,opts,1,val>=0);return false;}$.fn.cycle.custom=function(curr,next,opts,cb){var $l=$(curr),$n=$(next);$n.css(opts.cssBefore);var fn=function(){$n.animate(opts.animIn,opts.speedIn,opts.easeIn,cb);};$l.animate(opts.animOut,opts.speedOut,opts.easeOut,function(){$l.css(opts.cssAfter);if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){opts.cssBefore={opacity:0};opts.animOut={opacity:0};opts.animIn={opacity:1};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,speed:1000,next:null,prev:null,before:null,after:null,height:"auto",sync:1,fit:0,pause:0,delay:0,slideExpr:null,cssBefore:{},cssAfter:{},animIn:{},animOut:{}};})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,2 @@
/*!
* HTML5 Placeholder jQuery Plugin v1.8
* @link http://github.com/mathiasbynens/Placeholder-jQuery-Plugin
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
(function(f){var e='placeholder' in document.createElement('input'),a='placeholder' in document.createElement('textarea');if(e&&a){f.fn.placeholder=function(){return this}}else{f.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'[placeholder]').bind('focus.placeholder',b).bind('blur.placeholder',d).trigger('blur.placeholder').end()}}function c(h){var g={},i=/^jQuery\d+$/;f.each(h.attributes,function(k,j){if(j.specified&&!i.test(j.name)){g[j.name]=j.value}});return g}function b(){var g=f(this);if(g.val()===g.attr('placeholder')&&g.hasClass('placeholder')){if(g.data('placeholder-password')){g.hide().next().show().focus()}else{g.val('').removeClass('placeholder')}}}function d(i){var l,k=f(this),h=k,g=k.data('placeholder-init');if(k.val()===''||(!g&&k.val()===k.attr('placeholder'))){if(k.is(':password')){if(!k.data('placeholder-textinput')){try{l=k.clone().attr({type:'text'})}catch(j){l=f('<input>').attr(f.extend(c(k[0]),{type:'text'}))}l.removeAttr('name').data('placeholder-password',true).bind('focus.placeholder',b);k.data('placeholder-textinput',l).before(l)}k=k.hide().prev().show()}k.addClass('placeholder').val(k.attr('placeholder'))}else{k.removeClass('placeholder')}if(!g){h.data('placeholder-init',true)}}f(function(){f('form').bind('submit.placeholder',function(){var g=f('.placeholder',this).each(b);setTimeout(function(){g.each(d)},10)})});f(window).bind('unload.placeholder',function(){f('.placeholder').val('')})}(jQuery));
/*! http://mths.be/placeholder v1.8.4 by @mathias */
(function($){var e='placeholder' in document.createElement('input'),a='placeholder' in document.createElement('textarea');if(e&&a){$.fn.placeholder=function(){return this};$.fn.placeholder.input=$.fn.placeholder.textarea=true}else{$.fn.placeholder=function(){return this.filter((e?'textarea':':input')+'[placeholder]').bind('focus.placeholder',b).bind('blur.placeholder',d).trigger('blur.placeholder').end()};$.fn.placeholder.input=e;$.fn.placeholder.textarea=a;$(function(){$('form').bind('submit.placeholder',function(){var f=$('.placeholder',this).each(b);setTimeout(function(){f.each(d)},10)})});$(window).bind('unload.placeholder',function(){$('.placeholder').val('')})}function c(g){var f={},h=/^jQuery\d+$/;$.each(g.attributes,function(k,j){if(j.specified&&!h.test(j.name)){f[j.name]=j.value}});return f}function b(){var f=$(this);if(f.val()===f.attr('placeholder')&&f.hasClass('placeholder')){if(f.data('placeholder-password')){f.hide().next().attr('id',f.removeAttr('id').data('placeholder-id')).show().focus()}else{f.val('').removeClass('placeholder')}}}function d(){var j,i=$(this),f=i,h=this.id;if(i.val()===''){if(i.is(':password')){if(!i.data('placeholder-textinput')){try{j=i.clone().attr({type:'text'})}catch(g){j=$('<input>').attr($.extend(c(this),{type:'text'}))}j.removeAttr('name').data('placeholder-password',true).data('placeholder-id',h).bind('focus.placeholder',b);i.data('placeholder-textinput',j).data('placeholder-id',h).before(j)}i=i.removeAttr('id').hide().prev().attr('id',h).show()}i.addClass('placeholder').val(i.attr('placeholder'))}else{i.removeClass('placeholder')}}}(jQuery));