window.log = function(){ log.history = log.history || []; log.history.push(arguments); arguments.callee = arguments.callee.caller; if(this.console) console.log( Array.prototype.slice.call(arguments) ); }; (function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();)b[a]=b[a]||c})(window.console=window.console||{}); /* * jQuery Nivo Gallery v0.7 * http://dev7studios.com * * Copyright 2011, Gilbert Pellegrom * Free to use and abuse under the MIT license. * http://www.opensource.org/licenses/mit-license.php * * October 2011 */ (function($) { $.nivoGallery = function(element, options){ var defaults = { pauseTime: 3000, animSpeed: 300, effect: 'fade', startPaused: false, directionNav: true, progressBar: true, galleryLoaded: function(){}, beforeChange: function(index, slide, paused){}, afterChange: function(index, slide, paused){}, galleryEnd: function(){} } var global = { slides: [], currentSlide: 0, totalSlides: 0, animating: false, paused: false, timer: null, progressTimer: null } var plugin = this; plugin.settings = {} var $element = $(element), element = element; plugin.init = function(){ plugin.settings = $.extend({}, defaults, options); setupGallery(); } /* Private Funcs */ var setupGallery = function(){ global.slides = $element.find('ul li').remove(); global.totalSlides = global.slides.length; $element.find('ul').addClass('nivoGallery-slides'); if(plugin.settings.progressBar){ $element.append('
'); } if(plugin.settings.directionNav){ $element.append('
' + 'Prev Next' + '
'); } $element.append('
' + '' + '
'+ setCount() +'
' + '
'+ setCaption() +'
' + '' + '
').fadeIn(200); loadSlide(global.currentSlide); } var setCount = function(){ return (global.currentSlide + 1) +' / '+ global.totalSlides; } var setCaption = function(){ var title = $(global.slides[global.currentSlide]).attr('data-title'); var caption = $(global.slides[global.currentSlide]).attr('data-caption'); var output = ''; if(title) output += ''+ title +''; if(caption) output += caption; return output; } var runTimeout = function(){ clearTimeout(global.timer); if(plugin.settings.progressBar){ clearInterval(global.progressTimer); $element.find('.nivoGallery-progress').width('0%'); } if(!global.paused){ global.timer = setTimeout(function(){ $element.trigger('nextslide'); }, plugin.settings.pauseTime); if(plugin.settings.progressBar){ var progressStart = new Date(); global.progressTimer = setInterval(function(){ var ellapsed = new Date() - progressStart; var perc = (ellapsed / plugin.settings.pauseTime) * 100; $element.find('.nivoGallery-progress').width(perc + '%'); if(perc > 100){ clearInterval(global.progressTimer); $element.find('.nivoGallery-progress').width('0%'); } }, 10); } } } var loadSlide = function(idx, callbackFn){ if($(global.slides[idx]).data('loaded')){ if(typeof callbackFn == 'function') callbackFn.call(this); return; } if($(global.slides[idx]).find('img').length > 0 && ($(global.slides[idx]).attr('data-type') != 'html' && $(global.slides[idx]).attr('data-type') != 'video')){ $element.removeClass('loaded'); var img = new Image(); $(img).load(function(){ $element.find('.nivoGallery-slides').append(global.slides[idx]); $(global.slides[idx]).fadeIn(plugin.settings.animSpeed); if(idx == 0){ $element.trigger('galleryloaded'); } $element.addClass('loaded'); $(global.slides[idx]).data('loaded', true); $(global.slides[idx]).addClass('slide-'+ (idx + 1)); if(typeof callbackFn == 'function') callbackFn.call(this); }) .attr('src', $(global.slides[idx]).find('img:first').attr('src')) .attr('alt', ($(global.slides[idx]).find('img:first').attr('alt') != undefined) ? $(global.slides[idx]).find('img:first').attr('alt') : '') .attr('title', ($(global.slides[idx]).find('img:first').attr('title') != undefined) ? $(global.slides[idx]).find('img:first').attr('title') : ''); } else { $element.find('.nivoGallery-slides').append(global.slides[idx]); if(idx == 0){ $element.trigger('galleryloaded'); } $element.addClass('loaded'); $(global.slides[idx]).data('loaded', true); $(global.slides[idx]).addClass('slide-'+ (idx + 1)); if($(global.slides[idx]).attr('data-type') == 'html') $(global.slides[idx]).wrapInner('
'); if($(global.slides[idx]).attr('data-type') == 'video') $(global.slides[idx]).wrapInner('
'); if(typeof callbackFn == 'function') callbackFn.call(this); } } var runTransition = function(direction){ if(global.animating) return; plugin.settings.beforeChange.call(this, global.currentSlide, $(global.slides[global.currentSlide]), global.paused); if(plugin.settings.effect == 'fade'){ var galleryEnd = false; global.animating = true; $(global.slides[global.currentSlide]).fadeOut(plugin.settings.animSpeed, function(){ if(direction == 'prev'){ global.currentSlide--; if(global.currentSlide < 0){ global.currentSlide = global.totalSlides - 1; galleryEnd = true; } } else { global.currentSlide++; if(global.currentSlide >= global.totalSlides){ global.currentSlide = 0; galleryEnd = true; } } loadSlide(global.currentSlide, function(){ $element.find('.nivoGallery-count').text(setCount()); $element.find('.nivoGallery-caption').html(setCaption()); $(global.slides[global.currentSlide]).fadeIn(plugin.settings.animSpeed, function(){ global.animating = false; runTimeout(); plugin.settings.afterChange.call(this, global.currentSlide, $(global.slides[global.currentSlide]), global.paused); if(galleryEnd) plugin.settings.galleryEnd.call(this); }); }); }); } } /* Public Funcs */ plugin.play = function(){ $element.find('.nivoGallery-play').addClass('playing'); global.paused = false; runTimeout(); } plugin.pause = function(){ $element.find('.nivoGallery-play').removeClass('playing'); global.paused = true; runTimeout(); } plugin.nextSlide = function(){ plugin.pause(); runTransition('next'); } plugin.prevSlide = function(){ plugin.pause(); runTransition('prev'); } plugin.goTo = function(idx){ if(idx == global.currentSlide || global.animating) return; $(global.slides[global.currentSlide]).fadeOut(plugin.settings.animSpeed); global.currentSlide = (idx - 1); if(global.currentSlide < 0) global.currentSlide = global.totalSlides - 1; if(global.currentSlide >= global.totalSlides - 1) global.currentSlide = global.totalSlides - 2; plugin.pause(); runTransition('next'); } /* Events */ $element.bind('galleryloaded', function(){ $(global.slides[global.currentSlide]).fadeIn(200); if(plugin.settings.startPaused){ plugin.pause(); } else { runTimeout(); } plugin.settings.galleryLoaded.call(this); }); $element.find('.nivoGallery-play').live('click', function(){ $(this).toggleClass('playing'); global.paused = !global.paused; runTimeout(); return false; }); $element.bind('nextslide', function(){ runTransition('next'); }); $element.find('.nivoGallery-prev').live('click', function(){ plugin.prevSlide(); }); $element.find('.nivoGallery-next').live('click', function(){ plugin.nextSlide(); }); $element.find('.nivoGallery-fullscreen').live('click', function(){ $element.toggleClass('fullscreen'); }); $(document).keyup(function(e){ if(e.keyCode == 27){ $element.removeClass('fullscreen'); } }); plugin.init(); } $.fn.nivoGallery = function(options){ return this.each(function() { if (undefined == $(this).data('nivoGallery')){ var plugin = new $.nivoGallery(this, options); $(this).data('nivoGallery', plugin); } }); } })(jQuery); /* * Superfish v1.4.8 - jQuery menu widget * Copyright (c) 2008 Joel Birch * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt */ ;(function($){ $.fn.superfish = function(op){ var sf = $.fn.superfish, c = sf.c, $arrow = $([' »'].join('')), over = function(){ var $$ = $(this), menu = getMenu($$); clearTimeout(menu.sfTimer); $$.showSuperfishUl().siblings().hideSuperfishUl(); }, out = function(){ var $$ = $(this), menu = getMenu($$), o = sf.op; clearTimeout(menu.sfTimer); menu.sfTimer=setTimeout(function(){ o.retainPath=($.inArray($$[0],o.$path)>-1); $$.hideSuperfishUl(); if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);} },o.delay); }, getMenu = function($menu){ var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0]; sf.op = sf.o[menu.serial]; return menu; }, addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); }; return this.each(function() { var s = this.serial = sf.o.length; var o = $.extend({},sf.defaults,op); o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){ $(this).addClass([o.hoverClass,c.bcClass].join(' ')) .filter('li:has(ul)').removeClass(o.pathClass); }); sf.o[s] = sf.op = o; $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() { if (o.autoArrows) addArrow( $('>a:first-child',this) ); }) .not('.'+c.bcClass) .hideSuperfishUl(); var $a = $('a',this); $a.each(function(i){ var $li = $a.eq(i).parents('li'); $a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);}); }); o.onInit.call(this); }).each(function() { var menuClasses = [c.menuClass]; if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass); $(this).addClass(menuClasses.join(' ')); }); }; var sf = $.fn.superfish; sf.o = []; sf.op = {}; sf.IE7fix = function(){ var o = sf.op; if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined) this.toggleClass(sf.c.shadowClass+'-off'); }; sf.c = { bcClass : 'sf-breadcrumb', menuClass : 'sf-js-enabled', anchorClass : 'sf-with-ul', arrowClass : 'sf-sub-indicator', shadowClass : 'sf-shadow' }; sf.defaults = { hoverClass : 'sfHover', pathClass : 'overideThisToUse', pathLevels : 1, delay : 800, animation : {opacity:'show'}, speed : 'normal', autoArrows : true, dropShadows : true, disableHI : false, // true disables hoverIntent detection onInit : function(){}, // callback functions onBeforeShow: function(){}, onShow : function(){}, onHide : function(){} }; $.fn.extend({ hideSuperfishUl : function(){ var o = sf.op, not = (o.retainPath===true) ? o.$path : ''; o.retainPath = false; var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass) .find('>ul').hide().css('visibility','hidden'); o.onHide.call($ul); return this; }, showSuperfishUl : function(){ var o = sf.op, sh = sf.c.shadowClass+'-off', $ul = this.addClass(o.hoverClass) .find('>ul:hidden').css('visibility','visible'); sf.IE7fix.call($ul); o.onBeforeShow.call($ul); $ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); }); return this; } }); })(jQuery); (function($){ /* hoverIntent by Brian Cherne */ $.fn.hoverIntent = function(f,g) { // default configuration options var cfg = { sensitivity: 7, interval: 100, timeout: 0 }; // override configuration options with user supplied object cfg = $.extend(cfg, g ? { over: f, out: g } : f ); // instantiate variables // cX, cY = current X and Y position of mouse, updated by mousemove event // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval var cX, cY, pX, pY; // A private function for getting mouse position var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; // A private function for comparing current and previous mouse position var compare = function(ev,ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); // compare mouse positions to see if they've crossed the threshold if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) { $(ob).unbind("mousemove",track); // set hoverIntent state to true (so mouseOut can be called) ob.hoverIntent_s = 1; return cfg.over.apply(ob,[ev]); } else { // set previous coordinates for next time pX = cX; pY = cY; // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval ); } }; // A private function for delaying the mouseOut function var delay = function(ev,ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); ob.hoverIntent_s = 0; return cfg.out.apply(ob,[ev]); }; // A private function for handling mouse 'hovering' var handleHover = function(e) { // next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget; while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } } if ( p == this ) { return false; } // copy objects to be passed into t (required for event object to be passed in IE) var ev = jQuery.extend({},e); var ob = this; // cancel hoverIntent timer if it exists if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } // else e.type == "onmouseover" if (e.type == "mouseover") { // set "previous" X and Y position based on initial entry point pX = ev.pageX; pY = ev.pageY; // update "current" X and Y position based on mousemove $(ob).bind("mousemove",track); // start polling interval (self-calling timeout) to compare mouse coordinates over time if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );} // else e.type == "onmouseout" } else { // unbind expensive mousemove event $(ob).unbind("mousemove",track); // if hoverIntent state is true, then call the mouseOut function after the specified delay if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );} } }; // bind the function to the two event listeners return this.mouseover(handleHover).mouseout(handleHover); }; })(jQuery); /*! * MediaElement.js * HTML5