/* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */ jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g").get(0).files,e.formdata=void 0!==window.FormData;var f=!!a.fn.prop;a.fn.attr2=function(){if(!f)return this.attr.apply(this,arguments);var a=this.prop.apply(this,arguments);return a&&a.jquery||"string"==typeof a?a:this.attr.apply(this,arguments)},a.fn.ajaxSubmit=function(b){function c(c){var d,e,f=a.param(c,b.traditional).split("&"),g=f.length,h=[];for(d=0;g>d;d++)f[d]=f[d].replace(/\+/g," "),e=f[d].split("="),h.push([decodeURIComponent(e[0]),decodeURIComponent(e[1])]);return h}function g(d){for(var e=new FormData,f=0;f').val(m.extraData[n].value).appendTo(x)[0]):k.push(a('').val(m.extraData[n]).appendTo(x)[0]));m.iframeTarget||q.appendTo("body"),r.attachEvent?r.attachEvent("onload",h):r.addEventListener("load",h,!1),setTimeout(b,15);try{x.submit()}catch(p){var s=document.createElement("form").submit;s.apply(x)}}finally{x.setAttribute("action",f),x.setAttribute("enctype",j),c?x.setAttribute("target",c):l.removeAttr("target"),a(k).remove()}}function h(b){if(!s.aborted&&!F){if(E=e(r),E||(d("cannot access response document"),b=A),b===z&&s)return s.abort("timeout"),y.reject(s,"timeout"),void 0;if(b==A&&s)return s.abort("server abort"),y.reject(s,"error","server abort"),void 0;if(E&&E.location.href!=m.iframeSrc||v){r.detachEvent?r.detachEvent("onload",h):r.removeEventListener("load",h,!1);var c,f="success";try{if(v)throw"timeout";var g="xml"==m.dataType||E.XMLDocument||a.isXMLDoc(E);if(d("isXml="+g),!g&&window.opera&&(null===E.body||!E.body.innerHTML)&&--G)return d("requeing onLoad callback, DOM not available"),setTimeout(h,250),void 0;var i=E.body?E.body:E.documentElement;s.responseText=i?i.innerHTML:null,s.responseXML=E.XMLDocument?E.XMLDocument:E,g&&(m.dataType="xml"),s.getResponseHeader=function(a){var b={"content-type":m.dataType};return b[a.toLowerCase()]},i&&(s.status=Number(i.getAttribute("status"))||s.status,s.statusText=i.getAttribute("statusText")||s.statusText);var j=(m.dataType||"").toLowerCase(),k=/(json|script|text)/.test(j);if(k||m.textarea){var l=E.getElementsByTagName("textarea")[0];if(l)s.responseText=l.value,s.status=Number(l.getAttribute("status"))||s.status,s.statusText=l.getAttribute("statusText")||s.statusText;else if(k){var o=E.getElementsByTagName("pre")[0],p=E.getElementsByTagName("body")[0];o?s.responseText=o.textContent?o.textContent:o.innerText:p&&(s.responseText=p.textContent?p.textContent:p.innerText)}}else"xml"==j&&!s.responseXML&&s.responseText&&(s.responseXML=H(s.responseText));try{D=J(s,j,m)}catch(t){f="parsererror",s.error=c=t||f}}catch(t){d("error caught: ",t),f="error",s.error=c=t||f}s.aborted&&(d("upload aborted"),f=null),s.status&&(f=s.status>=200&&s.status<300||304===s.status?"success":"error"),"success"===f?(m.success&&m.success.call(m.context,D,"success",s),y.resolve(s.responseText,"success",s),n&&a.event.trigger("ajaxSuccess",[s,m])):f&&(void 0===c&&(c=s.statusText),m.error&&m.error.call(m.context,s,f,c),y.reject(s,"error",c),n&&a.event.trigger("ajaxError",[s,m,c])),n&&a.event.trigger("ajaxComplete",[s,m]),n&&!--a.active&&a.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,s,f),F=!0,m.timeout&&clearTimeout(w),setTimeout(function(){m.iframeTarget?q.attr("src",m.iframeSrc):q.remove(),s.responseXML=null},100)}}}var j,k,m,n,o,q,r,s,t,u,v,w,x=l[0],y=a.Deferred();if(y.abort=function(a){s.abort(a)},c)for(k=0;k'),q.css({position:"absolute",top:"-1000px",left:"-1000px"})),r=q[0],s={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(b){var c="timeout"===b?"timeout":"aborted";d("aborting upload... "+c),this.aborted=1;try{r.contentWindow.document.execCommand&&r.contentWindow.document.execCommand("Stop")}catch(e){}q.attr("src",m.iframeSrc),s.error=c,m.error&&m.error.call(m.context,s,c,b),n&&a.event.trigger("ajaxError",[s,m,c]),m.complete&&m.complete.call(m.context,s,c)}},n=m.global,n&&0===a.active++&&a.event.trigger("ajaxStart"),n&&a.event.trigger("ajaxSend",[s,m]),m.beforeSend&&m.beforeSend.call(m.context,s,m)===!1)return m.global&&a.active--,y.reject(),y;if(s.aborted)return y.reject(),y;t=x.clk,t&&(u=t.name,u&&!t.disabled&&(m.extraData=m.extraData||{},m.extraData[u]=t.value,"image"==t.type&&(m.extraData[u+".x"]=x.clk_x,m.extraData[u+".y"]=x.clk_y)));var z=1,A=2,B=a("meta[name=csrf-token]").attr("content"),C=a("meta[name=csrf-param]").attr("content");C&&B&&(m.extraData=m.extraData||{},m.extraData[C]=B),m.forceSync?g():setTimeout(g,10);var D,E,F,G=50,H=a.parseXML||function(a,b){return window.ActiveXObject?(b=new ActiveXObject("Microsoft.XMLDOM"),b.async="false",b.loadXML(a)):b=(new DOMParser).parseFromString(a,"text/xml"),b&&b.documentElement&&"parsererror"!=b.documentElement.nodeName?b:null},I=a.parseJSON||function(a){return window.eval("("+a+")")},J=function(b,c,d){var e=b.getResponseHeader("content-type")||"",f="xml"===c||!c&&e.indexOf("xml")>=0,g=f?b.responseXML:b.responseText;return f&&"parsererror"===g.documentElement.nodeName&&a.error&&a.error("parsererror"),d&&d.dataFilter&&(g=d.dataFilter(g,c)),"string"==typeof g&&("json"===c||!c&&e.indexOf("json")>=0?g=I(g):("script"===c||!c&&e.indexOf("javascript")>=0)&&a.globalEval(g)),g};return y}if(!this.length)return d("ajaxSubmit: skipping submit process - no element selected"),this;var i,j,k,l=this;"function"==typeof b?b={success:b}:void 0===b&&(b={}),i=b.type||this.attr2("method"),j=b.url||this.attr2("action"),k="string"==typeof j?a.trim(j):"",k=k||window.location.href||"",k&&(k=(k.match(/^([^#]+)/)||[])[1]),b=a.extend(!0,{url:k,success:a.ajaxSettings.success,type:i||a.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},b);var m={};if(this.trigger("form-pre-serialize",[this,b,m]),m.veto)return d("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(b.beforeSerialize&&b.beforeSerialize(this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var n=b.traditional;void 0===n&&(n=a.ajaxSettings.traditional);var o,p=[],q=this.formToArray(b.semantic,p);if(b.data&&(b.extraData=b.data,o=a.param(b.data,n)),b.beforeSubmit&&b.beforeSubmit(q,this,b)===!1)return d("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[q,this,b,m]),m.veto)return d("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var r=a.param(q,n);o&&(r=r?r+"&"+o:o),"GET"==b.type.toUpperCase()?(b.url+=(b.url.indexOf("?")>=0?"&":"?")+r,b.data=null):b.data=r;var s=[];if(b.resetForm&&s.push(function(){l.resetForm()}),b.clearForm&&s.push(function(){l.clearForm(b.includeHidden)}),!b.dataType&&b.target){var t=b.success||function(){};s.push(function(c){var d=b.replaceTarget?"replaceWith":"html";a(b.target)[d](c).each(t,arguments)})}else b.success&&s.push(b.success);if(b.success=function(a,c,d){for(var e=b.context||this,f=0,g=s.length;g>f;f++)s[f].apply(e,[a,c,d||l,l])},b.error){var u=b.error;b.error=function(a,c,d){var e=b.context||this;u.apply(e,[a,c,d,l])}}if(b.complete){var v=b.complete;b.complete=function(a,c){var d=b.context||this;v.apply(d,[a,c,l])}}var w=a("input[type=file]:enabled",this).filter(function(){return""!==a(this).val()}),x=w.length>0,y="multipart/form-data",z=l.attr("enctype")==y||l.attr("encoding")==y,A=e.fileapi&&e.formdata;d("fileAPI :"+A);var B,C=(x||z)&&!A;b.iframe!==!1&&(b.iframe||C)?b.closeKeepAlive?a.get(b.closeKeepAlive,function(){B=h(q)}):B=h(q):B=(x||z)&&A?g(q):a.ajax(b),l.removeData("jqxhr").data("jqxhr",B);for(var D=0;Dj;j++)if(n=i[j],l=n.name,l&&!n.disabled)if(b&&g.clk&&"image"==n.type)g.clk==n&&(d.push({name:l,value:a(n).val(),type:n.type}),d.push({name:l+".x",value:g.clk_x},{name:l+".y",value:g.clk_y}));else if(m=a.fieldValue(n,!0),m&&m.constructor==Array)for(c&&c.push(n),k=0,p=m.length;p>k;k++)d.push({name:l,value:m[k]});else if(e.fileapi&&"file"==n.type){c&&c.push(n);var q=n.files;if(q.length)for(k=0;kf;f++)c.push({name:d,value:e[f]});else null!==e&&"undefined"!=typeof e&&c.push({name:this.name,value:e})}}),a.param(c)},a.fn.fieldValue=function(b){for(var c=[],d=0,e=this.length;e>d;d++){var f=this[d],g=a.fieldValue(f,b);null===g||"undefined"==typeof g||g.constructor==Array&&!g.length||(g.constructor==Array?a.merge(c,g):c.push(g))}return c},a.fieldValue=function(b,c){var d=b.name,e=b.type,f=b.tagName.toLowerCase();if(void 0===c&&(c=!0),c&&(!d||b.disabled||"reset"==e||"button"==e||("checkbox"==e||"radio"==e)&&!b.checked||("submit"==e||"image"==e)&&b.form&&b.form.clk!=b||"select"==f&&-1==b.selectedIndex))return null;if("select"==f){var g=b.selectedIndex;if(0>g)return null;for(var h=[],i=b.options,j="select-one"==e,k=j?g+1:i.length,l=j?g:0;k>l;l++){var m=i[l];if(m.selected){var n=m.value;if(n||(n=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),j)return n;h.push(n)}}return h}return a(b).val()},a.fn.clearForm=function(b){return this.each(function(){a("input,select,textarea",this).clearFields(b)})},a.fn.clearFields=a.fn.clearInputs=function(b){var c=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var d=this.type,e=this.tagName.toLowerCase();c.test(d)||"textarea"==e?this.value="":"checkbox"==d||"radio"==d?this.checked=!1:"select"==e?this.selectedIndex=-1:"file"==d?/MSIE/.test(navigator.userAgent)?a(this).replaceWith(a(this).clone(!0)):a(this).val(""):b&&(b===!0&&/hidden/.test(d)||"string"==typeof b&&a(this).is(b))&&(this.value="")})},a.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},a.fn.enable=function(a){return void 0===a&&(a=!0),this.each(function(){this.disabled=!a})},a.fn.selected=function(b){return void 0===b&&(b=!0),this.each(function(){var c=this.type;if("checkbox"==c||"radio"==c)this.checked=b;else if("option"==this.tagName.toLowerCase()){var d=a(this).parent("select");b&&d[0]&&"select-one"==d[0].type&&d.find("option").selected(!1),this.selected=b}})},a.fn.ajaxSubmit.debug=!1}); /* jQuery blockUI plugin */ ;(function() { /*jshint eqeqeq:false curly:false latedef:false */ "use strict"; function setup($) { $.fn._fadeIn = $.fn.fadeIn; var noOp = $.noop || function() {}; // this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle // confusing userAgent strings on Vista) var msie = /MSIE/.test(navigator.userAgent); var ie6 = /MSIE 6.0/.test(navigator.userAgent) && ! /MSIE 8.0/.test(navigator.userAgent); var mode = document.documentMode || 0; var setExpr = $.isFunction( document.createElement('div').style.setExpression ); // global $ methods for blocking/unblocking the entire page $.blockUI = function(opts) { install(window, opts); }; $.unblockUI = function(opts) { remove(window, opts); }; // convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) $.growlUI = function(title, message, timeout, onClose) { var $m = $('
'); if (title) $m.append('

'+title+'

'); if (message) $m.append('

'+message+'

'); if (timeout === undefined) timeout = 3000; // Added by konapun: Set timeout to 30 seconds if this growl is moused over, like normal toast notifications var callBlock = function(opts) { opts = opts || {}; $.blockUI({ message: $m, fadeIn : typeof opts.fadeIn !== 'undefined' ? opts.fadeIn : 700, fadeOut: typeof opts.fadeOut !== 'undefined' ? opts.fadeOut : 1000, timeout: typeof opts.timeout !== 'undefined' ? opts.timeout : timeout, centerY: false, showOverlay: false, onUnblock: onClose, css: $.blockUI.defaults.growlCSS }); }; callBlock(); var nonmousedOpacity = $m.css('opacity'); $m.mouseover(function() { callBlock({ fadeIn: 0, timeout: 30000 }); var displayBlock = $('.blockMsg'); displayBlock.stop(); // cancel fadeout if it has started displayBlock.fadeTo(300, 1); // make it easier to read the message by removing transparency }).mouseout(function() { $('.blockMsg').fadeOut(1000); }); // End konapun additions }; // plugin method for blocking element content $.fn.block = function(opts) { if ( this[0] === window ) { $.blockUI( opts ); return this; } var fullOpts = $.extend({}, $.blockUI.defaults, opts || {}); this.each(function() { var $el = $(this); if (fullOpts.ignoreIfBlocked && $el.data('blockUI.isBlocked')) return; $el.unblock({ fadeOut: 0 }); }); return this.each(function() { if ($.css(this,'position') == 'static') { this.style.position = 'relative'; $(this).data('blockUI.static', true); } this.style.zoom = 1; // force 'hasLayout' in ie install(this, opts); }); }; // plugin method for unblocking element content $.fn.unblock = function(opts) { if ( this[0] === window ) { $.unblockUI( opts ); return this; } return this.each(function() { remove(this, opts); }); }; $.blockUI.version = 2.60; // 2nd generation blocking at no extra cost! // override these in your code to change the default behavior and style $.blockUI.defaults = { // message displayed when blocking (use null for no message) message: '

Please wait...

', title: null, // title string; only used when theme == true draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) theme: false, // set to true to use with jQuery UI themes // styles for the message when blocking; if you wish to disable // these and use an external stylesheet then do this in your code: // $.blockUI.defaults.css = {}; css: { padding: 0, margin: 0, width: '30%', top: '40%', left: '35%', textAlign: 'center', color: '#000', border: '3px solid #aaa', backgroundColor:'#fff', cursor: 'wait' }, // minimal style set used when themes are used themedCSS: { width: '30%', top: '40%', left: '35%' }, // styles for the overlay overlayCSS: { backgroundColor: '#000', opacity: 0.6, cursor: 'wait' }, // style to replace wait cursor before unblocking to correct issue // of lingering wait cursor cursorReset: 'default', // styles applied when using $.growlUI growlCSS: { width: '350px', top: '10px', left: '', right: '10px', border: 'none', padding: '5px', opacity: 0.6, cursor: 'default', color: '#fff', backgroundColor: '#000', '-webkit-border-radius':'10px', '-moz-border-radius': '10px', 'border-radius': '10px' }, // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w // (hat tip to Jorge H. N. de Vasconcelos) /*jshint scripturl:true */ iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', // force usage of iframe in non-IE browsers (handy for blocking applets) forceIframe: false, // z-index for the blocking overlay baseZ: 1000, // set these to true to have the message automatically centered centerX: true, // <-- only effects element blocking (page block controlled via css above) centerY: true, // allow body element to be stetched in ie6; this makes blocking look better // on "short" pages. disable if you wish to prevent changes to the body height allowBodyStretch: true, // enable if you want key and mouse events to be disabled for content that is blocked bindEvents: true, // be default blockUI will supress tab navigation from leaving blocking content // (if bindEvents is true) constrainTabKey: true, // fadeIn time in millis; set to 0 to disable fadeIn on block fadeIn: 200, // fadeOut time in millis; set to 0 to disable fadeOut on unblock fadeOut: 400, // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock timeout: 0, // disable if you don't want to show the overlay showOverlay: true, // if true, focus will be placed in the first available input field when // page blocking focusInput: true, // elements that can receive focus focusableElements: ':input:enabled:visible', // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) // no longer needed in 2012 // applyPlatformOpacityRules: true, // callback method invoked when fadeIn has completed and blocking message is visible onBlock: null, // callback method invoked when unblocking has completed; the callback is // passed the element that has been unblocked (which is the window object for page // blocks) and the options that were passed to the unblock call: // onUnblock(element, options) onUnblock: null, // callback method invoked when the overlay area is clicked. // setting this will turn the cursor to a pointer, otherwise cursor defined in overlayCss will be used. onOverlayClick: null, // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 quirksmodeOffsetHack: 4, // class name of the message block blockMsgClass: 'blockMsg', // if it is already blocked, then ignore it (don't unblock and reblock) ignoreIfBlocked: false }; // private data and functions follow... var pageBlock = null; var pageBlockEls = []; function install(el, opts) { var css, themedCSS; var full = (el == window); var msg = (opts && opts.message !== undefined ? opts.message : undefined); opts = $.extend({}, $.blockUI.defaults, opts || {}); if (opts.ignoreIfBlocked && $(el).data('blockUI.isBlocked')) return; opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); if (opts.onOverlayClick) opts.overlayCSS.cursor = 'pointer'; themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); msg = msg === undefined ? opts.message : msg; // remove the current block (if there is one) if (full && pageBlock) remove(window, {fadeOut:0}); // if an existing element is being used as the blocking content then we capture // its current place in the DOM (and current display style) so we can restore // it when we unblock if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { var node = msg.jquery ? msg[0] : msg; var data = {}; $(el).data('blockUI.history', data); data.el = node; data.parent = node.parentNode; data.display = node.style.display; data.position = node.style.position; if (data.parent) data.parent.removeChild(node); } $(el).data('blockUI.onUnblock', opts.onUnblock); var z = opts.baseZ; // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; // layer1 is the iframe layer which is used to supress bleed through of underlying content // layer2 is the overlay layer which has opacity and a wait cursor (by default) // layer3 is the message content that is displayed while blocking var lyr1, lyr2, lyr3, s; if (msie || opts.forceIframe) lyr1 = $(''); else lyr1 = $(''); if (opts.theme) lyr2 = $(''); else lyr2 = $(''); if (opts.theme && full) { s = ''; } else if (opts.theme) { s = ''; } else if (full) { s = ''; } else { s = ''; } lyr3 = $(s); // if we have a message, style it if (msg) { if (opts.theme) { lyr3.css(themedCSS); lyr3.addClass('ui-widget-content'); } else lyr3.css(css); } // style the overlay if (!opts.theme /*&& (!opts.applyPlatformOpacityRules)*/) lyr2.css(opts.overlayCSS); lyr2.css('position', full ? 'fixed' : 'absolute'); // make iframe layer transparent in IE if (msie || opts.forceIframe) lyr1.css('opacity',0.0); //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); $.each(layers, function() { this.appendTo($par); }); if (opts.theme && opts.draggable && $.fn.draggable) { lyr3.draggable({ handle: '.ui-dialog-titlebar', cancel: 'li' }); } // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) var expr = setExpr && (!$.support.boxModel || $('object,embed', full ? null : el).length > 0); if (ie6 || expr) { // give body 100% height if (full && opts.allowBodyStretch && $.support.boxModel) $('html,body').css('height','100%'); // fix ie6 issue when blocked element has a border width if ((ie6 || !$.support.boxModel) && !full) { var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); var fixT = t ? '(0 - '+t+')' : 0; var fixL = l ? '(0 - '+l+')' : 0; } // simulate fixed position $.each(layers, function(i,o) { var s = o[0].style; s.position = 'absolute'; if (i < 2) { if (full) s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"'); else s.setExpression('height','this.parentNode.offsetHeight + "px"'); if (full) s.setExpression('width','jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'); else s.setExpression('width','this.parentNode.offsetWidth + "px"'); if (fixL) s.setExpression('left', fixL); if (fixT) s.setExpression('top', fixT); } else if (opts.centerY) { if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); s.marginTop = 0; } else if (!opts.centerY && full) { var top = (opts.css && opts.css.top) ? parseInt(opts.css.top, 10) : 0; var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; s.setExpression('top',expression); } }); } // show the message if (msg) { if (opts.theme) lyr3.find('.ui-widget-content').append(msg); else lyr3.append(msg); if (msg.jquery || msg.nodeType) $(msg).show(); } if ((msie || opts.forceIframe) && opts.showOverlay) lyr1.show(); // opacity is zero if (opts.fadeIn) { var cb = opts.onBlock ? opts.onBlock : noOp; var cb1 = (opts.showOverlay && !msg) ? cb : noOp; var cb2 = msg ? cb : noOp; if (opts.showOverlay) lyr2._fadeIn(opts.fadeIn, cb1); if (msg) lyr3._fadeIn(opts.fadeIn, cb2); } else { if (opts.showOverlay) lyr2.show(); if (msg) lyr3.show(); if (opts.onBlock) opts.onBlock(); } // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; pageBlockEls = $(opts.focusableElements,pageBlock); if (opts.focusInput) setTimeout(focus, 20); } else center(lyr3[0], opts.centerX, opts.centerY); if (opts.timeout) { // auto-unblock var to = setTimeout(function() { if (full) $.unblockUI(opts); else $(el).unblock(opts); }, opts.timeout); $(el).data('blockUI.timeout', to); } } // remove the block function remove(el, opts) { var count; var full = (el == window); var $el = $(el); var data = $el.data('blockUI.history'); var to = $el.data('blockUI.timeout'); if (to) { clearTimeout(to); $el.removeData('blockUI.timeout'); } opts = $.extend({}, $.blockUI.defaults, opts || {}); bind(0, el, opts); // unbind events if (opts.onUnblock === null) { opts.onUnblock = $el.data('blockUI.onUnblock'); $el.removeData('blockUI.onUnblock'); } var els; if (full) // crazy selector to handle odd field errors in ie6/7 els = $('body').children().filter('.blockUI').add('body > .blockUI'); else els = $el.find('>.blockUI'); // fix cursor issue if ( opts.cursorReset ) { if ( els.length > 1 ) els[1].style.cursor = opts.cursorReset; if ( els.length > 2 ) els[2].style.cursor = opts.cursorReset; } if (full) pageBlock = pageBlockEls = null; if (opts.fadeOut) { count = els.length; els.stop().fadeOut(opts.fadeOut, function() { if ( --count === 0) reset(els,data,opts,el); }); } else reset(els, data, opts, el); } // move blocking element back into the DOM where it started function reset(els,data,opts,el) { var $el = $(el); els.each(function(i,o) { // remove via DOM calls so we don't lose event handlers if (this.parentNode) this.parentNode.removeChild(this); }); if (data && data.el) { data.el.style.display = data.display; data.el.style.position = data.position; if (data.parent) data.parent.appendChild(data.el); $el.removeData('blockUI.history'); } if ($el.data('blockUI.static')) { $el.css('position', 'static'); // #22 } if (typeof opts.onUnblock == 'function') opts.onUnblock(el,opts); // fix issue in Safari 6 where block artifacts remain until reflow var body = $(document.body), w = body.width(), cssW = body[0].style.width; body.width(w-1).width(w); body[0].style.width = cssW; } // bind/unbind the handler function bind(b, el, opts) { var full = el == window, $el = $(el); // don't bother unbinding if there is nothing to unbind if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) return; $el.data('blockUI.isBlocked', b); // don't bind events when overlay is not in use or if bindEvents is false if (!full || !opts.bindEvents || (b && !opts.showOverlay)) return; // bind anchors and inputs for mouse and key events var events = 'mousedown mouseup keydown keypress keyup touchstart touchend touchmove'; if (b) $(document).bind(events, opts, handler); else $(document).unbind(events, handler); // former impl... // var $e = $('a,:input'); // b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); } // event handler to suppress keyboard/mouse events when blocking function handler(e) { // allow tab navigation (conditionally) if (e.type === 'keydown' && e.keyCode && e.keyCode == 9) { if (pageBlock && e.data.constrainTabKey) { var els = pageBlockEls; var fwd = !e.shiftKey && e.target === els[els.length-1]; var back = e.shiftKey && e.target === els[0]; if (fwd || back) { setTimeout(function(){focus(back);},10); return false; } } } var opts = e.data; var target = $(e.target); if (target.hasClass('blockOverlay') && opts.onOverlayClick) opts.onOverlayClick(); // allow events within the message content if (target.parents('div.' + opts.blockMsgClass).length > 0) return true; // allow events for content that is not being blocked return target.parents().children().filter('div.blockUI').length === 0; } function focus(back) { if (!pageBlockEls) return; var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; if (e) e.focus(); } function center(el, x, y) { var p = el.parentNode, s = el.style; var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); if (x) s.left = l > 0 ? (l+'px') : '0'; if (y) s.top = t > 0 ? (t+'px') : '0'; } function sz(el, p) { return parseInt($.css(el,p),10)||0; } } /*global define:true */ if (typeof define === 'function' && define.amd && define.amd.jQuery) { define(['jquery'], setup); } else { setup(jQuery); } })(); /** * jQuery Cookie plugin * */ jQuery.cookie = function (key, value, options) { // key and value given, set cookie... if (arguments.length > 1 && (value === null || typeof value !== "object")) { options = jQuery.extend({}, options); if (value === null) { options.expires = -1; } if (typeof options.expires === 'number') { var days = options.expires, t = options.expires = new Date(); t.setDate(t.getDate() + days); } return (document.cookie = [ encodeURIComponent(key), '=', options.raw ? String(value) : encodeURIComponent(String(value)), options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE options.path ? '; path=' + options.path : '', options.domain ? '; domain=' + options.domain : '', options.secure ? '; secure' : '' ].join('')); } // key and possibly options given, get cookie... options = value || {}; var result, decode = options.raw ? function (s) { return s; } : decodeURIComponent; return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; }; /* * Style File - jQuery plugin for styling file input elements * * Copyright (c) 2007-2008 Mika Tuupola * * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * * Based on work by Shaun Inman * http://www.shauninman.com/archive/2007/09/10/styling_file_inputs_with_css_and_the_dom * * Revision: $Id: jquery.filestyle.js 303 2008-01-30 13:53:24Z tuupola $ * */ (function($) { $.fn.filestyle = function(options) { var settings = { width : 200 }; if(options) { $.extend(settings, options); }; return this.each(function() { var self = this; var wrapper = $("
").css({ "width": settings.imagewidth + "px", "height": settings.imageheight + "px", "background": "url(" + settings.image + ") 0 0 no-repeat", "background-position": "right", "display": "inline", "position": "absolute", "overflow": "hidden", "margin-left": settings.marginleft + "px" }); var filename = $('').addClass($(self).attr("class")).css({ "display": "inline", "margin-left": "20px", "width": settings.width + "px" }); $(self).before(filename); $(self).wrap(wrapper); $(self).css({ "position": "relative", "height": settings.imageheight + "px", "width": settings.width + "px", "display": "inline", "cursor": "pointer", "opacity": "0.0" }); if ($.browser.mozilla) { if (/Win/.test(navigator.platform)) { $(self).css("margin-left", "-142px"); } else { $(self).css("margin-left", "-168px"); }; } else { $(self).css("margin-left", settings.imagewidth - settings.width + "px"); }; $(self).bind("change", function() { filename.val($(self).val()); }); }); }; })(jQuery); /*! * jQuery Cycle2; version: 2.1.6 build: 20141007 * http://jquery.malsup.com/cycle2/ * Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL */ /* Cycle2 core engine */ ;(function($) { "use strict"; var version = '2.1.6'; $.fn.cycle = function( options ) { // fix mistakes with the ready state var o; if ( this.length === 0 && !$.isReady ) { o = { s: this.selector, c: this.context }; $.fn.cycle.log('requeuing slideshow (dom not ready)'); $(function() { $( o.s, o.c ).cycle(options); }); return this; } return this.each(function() { var data, opts, shortName, val; var container = $(this); var log = $.fn.cycle.log; if ( container.data('cycle.opts') ) return; // already initialized if ( container.data('cycle-log') === false || ( options && options.log === false ) || ( opts && opts.log === false) ) { log = $.noop; } log('--c2 init--'); data = container.data(); for (var p in data) { // allow props to be accessed sans 'cycle' prefix and log the overrides if (data.hasOwnProperty(p) && /^cycle[A-Z]+/.test(p) ) { val = data[p]; shortName = p.match(/^cycle(.*)/)[1].replace(/^[A-Z]/, lowerCase); log(shortName+':', val, '('+typeof val +')'); data[shortName] = val; } } opts = $.extend( {}, $.fn.cycle.defaults, data, options || {}); opts.timeoutId = 0; opts.paused = opts.paused || false; // #57 opts.container = container; opts._maxZ = opts.maxZ; opts.API = $.extend ( { _container: container }, $.fn.cycle.API ); opts.API.log = log; opts.API.trigger = function( eventName, args ) { opts.container.trigger( eventName, args ); return opts.API; }; container.data( 'cycle.opts', opts ); container.data( 'cycle.API', opts.API ); // opportunity for plugins to modify opts and API opts.API.trigger('cycle-bootstrap', [ opts, opts.API ]); opts.API.addInitialSlides(); opts.API.preInitSlideshow(); if ( opts.slides.length ) opts.API.initSlideshow(); }); }; $.fn.cycle.API = { opts: function() { return this._container.data( 'cycle.opts' ); }, addInitialSlides: function() { var opts = this.opts(); var slides = opts.slides; opts.slideCount = 0; opts.slides = $(); // empty set // add slides that already exist slides = slides.jquery ? slides : opts.container.find( slides ); if ( opts.random ) { slides.sort(function() {return Math.random() - 0.5;}); } opts.API.add( slides ); }, preInitSlideshow: function() { var opts = this.opts(); opts.API.trigger('cycle-pre-initialize', [ opts ]); var tx = $.fn.cycle.transitions[opts.fx]; if (tx && $.isFunction(tx.preInit)) tx.preInit( opts ); opts._preInitialized = true; }, postInitSlideshow: function() { var opts = this.opts(); opts.API.trigger('cycle-post-initialize', [ opts ]); var tx = $.fn.cycle.transitions[opts.fx]; if (tx && $.isFunction(tx.postInit)) tx.postInit( opts ); }, initSlideshow: function() { var opts = this.opts(); var pauseObj = opts.container; var slideOpts; opts.API.calcFirstSlide(); if ( opts.container.css('position') == 'static' ) opts.container.css('position', 'relative'); $(opts.slides[opts.currSlide]).css({ opacity: 1, display: 'block', visibility: 'visible' }); opts.API.stackSlides( opts.slides[opts.currSlide], opts.slides[opts.nextSlide], !opts.reverse ); if ( opts.pauseOnHover ) { // allow pauseOnHover to specify an element if ( opts.pauseOnHover !== true ) pauseObj = $( opts.pauseOnHover ); pauseObj.hover( function(){ opts.API.pause( true ); }, function(){ opts.API.resume( true ); } ); } // stage initial transition if ( opts.timeout ) { slideOpts = opts.API.getSlideOpts( opts.currSlide ); opts.API.queueTransition( slideOpts, slideOpts.timeout + opts.delay ); } opts._initialized = true; opts.API.updateView( true ); opts.API.trigger('cycle-initialized', [ opts ]); opts.API.postInitSlideshow(); }, pause: function( hover ) { var opts = this.opts(), slideOpts = opts.API.getSlideOpts(), alreadyPaused = opts.hoverPaused || opts.paused; if ( hover ) opts.hoverPaused = true; else opts.paused = true; if ( ! alreadyPaused ) { opts.container.addClass('cycle-paused'); opts.API.trigger('cycle-paused', [ opts ]).log('cycle-paused'); if ( slideOpts.timeout ) { clearTimeout( opts.timeoutId ); opts.timeoutId = 0; // determine how much time is left for the current slide opts._remainingTimeout -= ( $.now() - opts._lastQueue ); if ( opts._remainingTimeout < 0 || isNaN(opts._remainingTimeout) ) opts._remainingTimeout = undefined; } } }, resume: function( hover ) { var opts = this.opts(), alreadyResumed = !opts.hoverPaused && !opts.paused, remaining; if ( hover ) opts.hoverPaused = false; else opts.paused = false; if ( ! alreadyResumed ) { opts.container.removeClass('cycle-paused'); // #gh-230; if an animation is in progress then don't queue a new transition; it will // happen naturally if ( opts.slides.filter(':animated').length === 0 ) opts.API.queueTransition( opts.API.getSlideOpts(), opts._remainingTimeout ); opts.API.trigger('cycle-resumed', [ opts, opts._remainingTimeout ] ).log('cycle-resumed'); } }, add: function( slides, prepend ) { var opts = this.opts(); var oldSlideCount = opts.slideCount; var startSlideshow = false; var len; if ( $.type(slides) == 'string') slides = $.trim( slides ); $( slides ).each(function(i) { var slideOpts; var slide = $(this); if ( prepend ) opts.container.prepend( slide ); else opts.container.append( slide ); opts.slideCount++; slideOpts = opts.API.buildSlideOpts( slide ); if ( prepend ) opts.slides = $( slide ).add( opts.slides ); else opts.slides = opts.slides.add( slide ); opts.API.initSlide( slideOpts, slide, --opts._maxZ ); slide.data('cycle.opts', slideOpts); opts.API.trigger('cycle-slide-added', [ opts, slideOpts, slide ]); }); opts.API.updateView( true ); startSlideshow = opts._preInitialized && (oldSlideCount < 2 && opts.slideCount >= 1); if ( startSlideshow ) { if ( !opts._initialized ) opts.API.initSlideshow(); else if ( opts.timeout ) { len = opts.slides.length; opts.nextSlide = opts.reverse ? len - 1 : 1; if ( !opts.timeoutId ) { opts.API.queueTransition( opts ); } } } }, calcFirstSlide: function() { var opts = this.opts(); var firstSlideIndex; firstSlideIndex = parseInt( opts.startingSlide || 0, 10 ); if (firstSlideIndex >= opts.slides.length || firstSlideIndex < 0) firstSlideIndex = 0; opts.currSlide = firstSlideIndex; if ( opts.reverse ) { opts.nextSlide = firstSlideIndex - 1; if (opts.nextSlide < 0) opts.nextSlide = opts.slides.length - 1; } else { opts.nextSlide = firstSlideIndex + 1; if (opts.nextSlide == opts.slides.length) opts.nextSlide = 0; } }, calcNextSlide: function() { var opts = this.opts(); var roll; if ( opts.reverse ) { roll = (opts.nextSlide - 1) < 0; opts.nextSlide = roll ? opts.slideCount - 1 : opts.nextSlide-1; opts.currSlide = roll ? 0 : opts.nextSlide+1; } else { roll = (opts.nextSlide + 1) == opts.slides.length; opts.nextSlide = roll ? 0 : opts.nextSlide+1; opts.currSlide = roll ? opts.slides.length-1 : opts.nextSlide-1; } }, calcTx: function( slideOpts, manual ) { var opts = slideOpts; var tx; if ( opts._tempFx ) tx = $.fn.cycle.transitions[opts._tempFx]; else if ( manual && opts.manualFx ) tx = $.fn.cycle.transitions[opts.manualFx]; if ( !tx ) tx = $.fn.cycle.transitions[opts.fx]; opts._tempFx = null; this.opts()._tempFx = null; if (!tx) { tx = $.fn.cycle.transitions.fade; opts.API.log('Transition "' + opts.fx + '" not found. Using fade.'); } return tx; }, prepareTx: function( manual, fwd ) { var opts = this.opts(); var after, curr, next, slideOpts, tx; if ( opts.slideCount < 2 ) { opts.timeoutId = 0; return; } if ( manual && ( !opts.busy || opts.manualTrump ) ) { opts.API.stopTransition(); opts.busy = false; clearTimeout(opts.timeoutId); opts.timeoutId = 0; } if ( opts.busy ) return; if ( opts.timeoutId === 0 && !manual ) return; curr = opts.slides[opts.currSlide]; next = opts.slides[opts.nextSlide]; slideOpts = opts.API.getSlideOpts( opts.nextSlide ); tx = opts.API.calcTx( slideOpts, manual ); opts._tx = tx; if ( manual && slideOpts.manualSpeed !== undefined ) slideOpts.speed = slideOpts.manualSpeed; // if ( opts.nextSlide === opts.currSlide ) // opts.API.calcNextSlide(); // ensure that: // 1. advancing to a different slide // 2. this is either a manual event (prev/next, pager, cmd) or // a timer event and slideshow is not paused if ( opts.nextSlide != opts.currSlide && (manual || (!opts.paused && !opts.hoverPaused && opts.timeout) )) { // #62 opts.API.trigger('cycle-before', [ slideOpts, curr, next, fwd ]); if ( tx.before ) tx.before( slideOpts, curr, next, fwd ); after = function() { opts.busy = false; // #76; bail if slideshow has been destroyed if (! opts.container.data( 'cycle.opts' ) ) return; if (tx.after) tx.after( slideOpts, curr, next, fwd ); opts.API.trigger('cycle-after', [ slideOpts, curr, next, fwd ]); opts.API.queueTransition( slideOpts); opts.API.updateView( true ); }; opts.busy = true; if (tx.transition) tx.transition(slideOpts, curr, next, fwd, after); else opts.API.doTransition( slideOpts, curr, next, fwd, after); opts.API.calcNextSlide(); opts.API.updateView(); } else { opts.API.queueTransition( slideOpts ); } }, // perform the actual animation doTransition: function( slideOpts, currEl, nextEl, fwd, callback) { var opts = slideOpts; var curr = $(currEl), next = $(nextEl); var fn = function() { // make sure animIn has something so that callback doesn't trigger immediately next.animate(opts.animIn || { opacity: 1}, opts.speed, opts.easeIn || opts.easing, callback); }; next.css(opts.cssBefore || {}); curr.animate(opts.animOut || {}, opts.speed, opts.easeOut || opts.easing, function() { curr.css(opts.cssAfter || {}); if (!opts.sync) { fn(); } }); if (opts.sync) { fn(); } }, queueTransition: function( slideOpts, specificTimeout ) { var opts = this.opts(); var timeout = specificTimeout !== undefined ? specificTimeout : slideOpts.timeout; if (opts.nextSlide === 0 && --opts.loop === 0) { opts.API.log('terminating; loop=0'); opts.timeout = 0; if ( timeout ) { setTimeout(function() { opts.API.trigger('cycle-finished', [ opts ]); }, timeout); } else { opts.API.trigger('cycle-finished', [ opts ]); } // reset nextSlide opts.nextSlide = opts.currSlide; return; } if ( opts.continueAuto !== undefined ) { if ( opts.continueAuto === false || ($.isFunction(opts.continueAuto) && opts.continueAuto() === false )) { opts.API.log('terminating automatic transitions'); opts.timeout = 0; if ( opts.timeoutId ) clearTimeout(opts.timeoutId); return; } } if ( timeout ) { opts._lastQueue = $.now(); if ( specificTimeout === undefined ) opts._remainingTimeout = slideOpts.timeout; if ( !opts.paused && ! opts.hoverPaused ) { opts.timeoutId = setTimeout(function() { opts.API.prepareTx( false, !opts.reverse ); }, timeout ); } } }, stopTransition: function() { var opts = this.opts(); if ( opts.slides.filter(':animated').length ) { opts.slides.stop(false, true); opts.API.trigger('cycle-transition-stopped', [ opts ]); } if ( opts._tx && opts._tx.stopTransition ) opts._tx.stopTransition( opts ); }, // advance slide forward or back advanceSlide: function( val ) { var opts = this.opts(); clearTimeout(opts.timeoutId); opts.timeoutId = 0; opts.nextSlide = opts.currSlide + val; if (opts.nextSlide < 0) opts.nextSlide = opts.slides.length - 1; else if (opts.nextSlide >= opts.slides.length) opts.nextSlide = 0; opts.API.prepareTx( true, val >= 0 ); return false; }, buildSlideOpts: function( slide ) { var opts = this.opts(); var val, shortName; var slideOpts = slide.data() || {}; for (var p in slideOpts) { // allow props to be accessed sans 'cycle' prefix and log the overrides if (slideOpts.hasOwnProperty(p) && /^cycle[A-Z]+/.test(p) ) { val = slideOpts[p]; shortName = p.match(/^cycle(.*)/)[1].replace(/^[A-Z]/, lowerCase); opts.API.log('['+(opts.slideCount-1)+']', shortName+':', val, '('+typeof val +')'); slideOpts[shortName] = val; } } slideOpts = $.extend( {}, $.fn.cycle.defaults, opts, slideOpts ); slideOpts.slideNum = opts.slideCount; try { // these props should always be read from the master state object delete slideOpts.API; delete slideOpts.slideCount; delete slideOpts.currSlide; delete slideOpts.nextSlide; delete slideOpts.slides; } catch(e) { // no op } return slideOpts; }, getSlideOpts: function( index ) { var opts = this.opts(); if ( index === undefined ) index = opts.currSlide; var slide = opts.slides[index]; var slideOpts = $(slide).data('cycle.opts'); return $.extend( {}, opts, slideOpts ); }, initSlide: function( slideOpts, slide, suggestedZindex ) { var opts = this.opts(); slide.css( slideOpts.slideCss || {} ); if ( suggestedZindex > 0 ) slide.css( 'zIndex', suggestedZindex ); // ensure that speed settings are sane if ( isNaN( slideOpts.speed ) ) slideOpts.speed = $.fx.speeds[slideOpts.speed] || $.fx.speeds._default; if ( !slideOpts.sync ) slideOpts.speed = slideOpts.speed / 2; slide.addClass( opts.slideClass ); }, updateView: function( isAfter, isDuring, forceEvent ) { var opts = this.opts(); if ( !opts._initialized ) return; var slideOpts = opts.API.getSlideOpts(); var currSlide = opts.slides[ opts.currSlide ]; if ( ! isAfter && isDuring !== true ) { opts.API.trigger('cycle-update-view-before', [ opts, slideOpts, currSlide ]); if ( opts.updateView < 0 ) return; } if ( opts.slideActiveClass ) { opts.slides.removeClass( opts.slideActiveClass ) .eq( opts.currSlide ).addClass( opts.slideActiveClass ); } if ( isAfter && opts.hideNonActive ) opts.slides.filter( ':not(.' + opts.slideActiveClass + ')' ).css('visibility', 'hidden'); if ( opts.updateView === 0 ) { setTimeout(function() { opts.API.trigger('cycle-update-view', [ opts, slideOpts, currSlide, isAfter ]); }, slideOpts.speed / (opts.sync ? 2 : 1) ); } if ( opts.updateView !== 0 ) opts.API.trigger('cycle-update-view', [ opts, slideOpts, currSlide, isAfter ]); if ( isAfter ) opts.API.trigger('cycle-update-view-after', [ opts, slideOpts, currSlide ]); }, getComponent: function( name ) { var opts = this.opts(); var selector = opts[name]; if (typeof selector === 'string') { // if selector is a child, sibling combinator, adjancent selector then use find, otherwise query full dom return (/^\s*[\>|\+|~]/).test( selector ) ? opts.container.find( selector ) : $( selector ); } if (selector.jquery) return selector; return $(selector); }, stackSlides: function( curr, next, fwd ) { var opts = this.opts(); if ( !curr ) { curr = opts.slides[opts.currSlide]; next = opts.slides[opts.nextSlide]; fwd = !opts.reverse; } // reset the zIndex for the common case: // curr slide on top, next slide beneath, and the rest in order to be shown $(curr).css('zIndex', opts.maxZ); var i; var z = opts.maxZ - 2; var len = opts.slideCount; if (fwd) { for ( i = opts.currSlide + 1; i < len; i++ ) $( opts.slides[i] ).css( 'zIndex', z-- ); for ( i = 0; i < opts.currSlide; i++ ) $( opts.slides[i] ).css( 'zIndex', z-- ); } else { for ( i = opts.currSlide - 1; i >= 0; i-- ) $( opts.slides[i] ).css( 'zIndex', z-- ); for ( i = len - 1; i > opts.currSlide; i-- ) $( opts.slides[i] ).css( 'zIndex', z-- ); } $(next).css('zIndex', opts.maxZ - 1); }, getSlideIndex: function( el ) { return this.opts().slides.index( el ); } }; // API // default logger $.fn.cycle.log = function log() { /*global console:true */ if (window.console && console.log) console.log('[cycle2] ' + Array.prototype.join.call(arguments, ' ') ); }; $.fn.cycle.version = function() { return 'Cycle2: ' + version; }; // helper functions function lowerCase(s) { return (s || '').toLowerCase(); } // expose transition object $.fn.cycle.transitions = { custom: { }, none: { before: function( opts, curr, next, fwd ) { opts.API.stackSlides( next, curr, fwd ); opts.cssBefore = { opacity: 1, visibility: 'visible', display: 'block' }; } }, fade: { before: function( opts, curr, next, fwd ) { var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {}; opts.API.stackSlides( curr, next, fwd ); opts.cssBefore = $.extend(css, { opacity: 0, visibility: 'visible', display: 'block' }); opts.animIn = { opacity: 1 }; opts.animOut = { opacity: 0 }; } }, fadeout: { before: function( opts , curr, next, fwd ) { var css = opts.API.getSlideOpts( opts.nextSlide ).slideCss || {}; opts.API.stackSlides( curr, next, fwd ); opts.cssBefore = $.extend(css, { opacity: 1, visibility: 'visible', display: 'block' }); opts.animOut = { opacity: 0 }; } }, scrollHorz: { before: function( opts, curr, next, fwd ) { opts.API.stackSlides( curr, next, fwd ); var w = opts.container.css('overflow','hidden').width(); opts.cssBefore = { left: fwd ? w : - w, top: 0, opacity: 1, visibility: 'visible', display: 'block' }; opts.cssAfter = { zIndex: opts._maxZ - 2, left: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: fwd ? -w : w }; } }, scrollHorzReverse: { before: function( opts, curr, next, fwd ) { opts.API.stackSlides( curr, next, fwd ); var w = opts.container.css('overflow','hidden').width(); opts.cssBefore = { left: fwd ? - w : w, top: 0, opacity: 1, visibility: 'visible', display: 'block' }; opts.cssAfter = { zIndex: opts._maxZ - 2, left: 0 }; opts.animIn = { left: 0 }; opts.animOut = { left: fwd ? w : -w }; } } }; // @see: http://jquery.malsup.com/cycle2/api $.fn.cycle.defaults = { allowWrap: true, autoSelector: '.cycle-slideshow[data-cycle-auto-init!=false]', delay: 0, easing: null, fx: 'fade', hideNonActive: true, loop: 0, manualFx: undefined, manualSpeed: undefined, manualTrump: true, maxZ: 100, pauseOnHover: false, reverse: false, slideActiveClass: 'cycle-slide-active', slideClass: 'cycle-slide', slideCss: { position: 'absolute', top: 0, left: 0 }, slides: '> img', speed: 500, startingSlide: 0, sync: true, timeout: 4000, updateView: 0 }; // automatically find and run slideshows $(document).ready(function() { $( $.fn.cycle.defaults.autoSelector ).cycle(); }); })(jQuery); /*! Cycle2 autoheight plugin; Copyright (c) M.Alsup, 2012; version: 20130913 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { autoHeight: 0, // setting this option to false disables autoHeight logic autoHeightSpeed: 250, autoHeightEasing: null }); $(document).on( 'cycle-initialized', function( e, opts ) { var autoHeight = opts.autoHeight; var t = $.type( autoHeight ); var resizeThrottle = null; var ratio; if ( t !== 'string' && t !== 'number' ) return; // bind events opts.container.on( 'cycle-slide-added cycle-slide-removed', initAutoHeight ); opts.container.on( 'cycle-destroyed', onDestroy ); if ( autoHeight == 'container' ) { opts.container.on( 'cycle-before', onBefore ); } else if ( t === 'string' && /\d+\:\d+/.test( autoHeight ) ) { // use ratio ratio = autoHeight.match(/(\d+)\:(\d+)/); ratio = ratio[1] / ratio[2]; opts._autoHeightRatio = ratio; } // if autoHeight is a number then we don't need to recalculate the sentinel // index on resize if ( t !== 'number' ) { // bind unique resize handler per slideshow (so it can be 'off-ed' in onDestroy) opts._autoHeightOnResize = function () { clearTimeout( resizeThrottle ); resizeThrottle = setTimeout( onResize, 50 ); }; $(window).on( 'resize orientationchange', opts._autoHeightOnResize ); } setTimeout( onResize, 30 ); function onResize() { initAutoHeight( e, opts ); } }); function initAutoHeight( e, opts ) { var clone, height, sentinelIndex; var autoHeight = opts.autoHeight; if ( autoHeight == 'container' ) { height = $( opts.slides[ opts.currSlide ] ).outerHeight(); opts.container.height( height ); } else if ( opts._autoHeightRatio ) { opts.container.height( opts.container.width() / opts._autoHeightRatio ); } else if ( autoHeight === 'calc' || ( $.type( autoHeight ) == 'number' && autoHeight >= 0 ) ) { if ( autoHeight === 'calc' ) sentinelIndex = calcSentinelIndex( e, opts ); else if ( autoHeight >= opts.slides.length ) sentinelIndex = 0; else sentinelIndex = autoHeight; // only recreate sentinel if index is different if ( sentinelIndex == opts._sentinelIndex ) return; opts._sentinelIndex = sentinelIndex; if ( opts._sentinel ) opts._sentinel.remove(); // clone existing slide as sentinel clone = $( opts.slides[ sentinelIndex ].cloneNode(true) ); // #50; remove special attributes from cloned content clone.removeAttr( 'id name rel' ).find( '[id],[name],[rel]' ).removeAttr( 'id name rel' ); clone.css({ position: 'static', visibility: 'hidden', display: 'block' }).prependTo( opts.container ).addClass('cycle-sentinel cycle-slide').removeClass('cycle-slide-active'); clone.find( '*' ).css( 'visibility', 'hidden' ); opts._sentinel = clone; } } function calcSentinelIndex( e, opts ) { var index = 0, max = -1; // calculate tallest slide index opts.slides.each(function(i) { var h = $(this).height(); if ( h > max ) { max = h; index = i; } }); return index; } function onBefore( e, opts, outgoing, incoming, forward ) { var h = $(incoming).outerHeight(); opts.container.animate( { height: h }, opts.autoHeightSpeed, opts.autoHeightEasing ); } function onDestroy( e, opts ) { if ( opts._autoHeightOnResize ) { $(window).off( 'resize orientationchange', opts._autoHeightOnResize ); opts._autoHeightOnResize = null; } opts.container.off( 'cycle-slide-added cycle-slide-removed', initAutoHeight ); opts.container.off( 'cycle-destroyed', onDestroy ); opts.container.off( 'cycle-before', onBefore ); if ( opts._sentinel ) { opts._sentinel.remove(); opts._sentinel = null; } } })(jQuery); /*! caption plugin for Cycle2; version: 20130306 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { caption: '> .cycle-caption', captionTemplate: '{{slideNum}} / {{slideCount}}', overlay: '> .cycle-overlay', overlayTemplate: '
{{title}}
{{desc}}
', captionModule: 'caption' }); $(document).on( 'cycle-update-view', function( e, opts, slideOpts, currSlide ) { if ( opts.captionModule !== 'caption' ) return; var el; $.each(['caption','overlay'], function() { var name = this; var template = slideOpts[name+'Template']; var el = opts.API.getComponent( name ); if( el.length && template ) { el.html( opts.API.tmpl( template, slideOpts, opts, currSlide ) ); el.show(); } else { el.hide(); } }); }); $(document).on( 'cycle-destroyed', function( e, opts ) { var el; $.each(['caption','overlay'], function() { var name = this, template = opts[name+'Template']; if ( opts[name] && template ) { el = opts.API.getComponent( 'caption' ); el.empty(); } }); }); })(jQuery); /*! command plugin for Cycle2; version: 20140415 */ (function($) { "use strict"; var c2 = $.fn.cycle; $.fn.cycle = function( options ) { var cmd, cmdFn, opts; var args = $.makeArray( arguments ); if ( $.type( options ) == 'number' ) { return this.cycle( 'goto', options ); } if ( $.type( options ) == 'string' ) { return this.each(function() { var cmdArgs; cmd = options; opts = $(this).data('cycle.opts'); if ( opts === undefined ) { c2.log('slideshow must be initialized before sending commands; "' + cmd + '" ignored'); return; } else { cmd = cmd == 'goto' ? 'jump' : cmd; // issue #3; change 'goto' to 'jump' internally cmdFn = opts.API[ cmd ]; if ( $.isFunction( cmdFn )) { cmdArgs = $.makeArray( args ); cmdArgs.shift(); return cmdFn.apply( opts.API, cmdArgs ); } else { c2.log( 'unknown command: ', cmd ); } } }); } else { return c2.apply( this, arguments ); } }; // copy props $.extend( $.fn.cycle, c2 ); $.extend( c2.API, { next: function() { var opts = this.opts(); if ( opts.busy && ! opts.manualTrump ) return; var count = opts.reverse ? -1 : 1; if ( opts.allowWrap === false && ( opts.currSlide + count ) >= opts.slideCount ) return; opts.API.advanceSlide( count ); opts.API.trigger('cycle-next', [ opts ]).log('cycle-next'); }, prev: function() { var opts = this.opts(); if ( opts.busy && ! opts.manualTrump ) return; var count = opts.reverse ? 1 : -1; if ( opts.allowWrap === false && ( opts.currSlide + count ) < 0 ) return; opts.API.advanceSlide( count ); opts.API.trigger('cycle-prev', [ opts ]).log('cycle-prev'); }, destroy: function() { this.stop(); //#204 var opts = this.opts(); var clean = $.isFunction( $._data ) ? $._data : $.noop; // hack for #184 and #201 clearTimeout(opts.timeoutId); opts.timeoutId = 0; opts.API.stop(); opts.API.trigger( 'cycle-destroyed', [ opts ] ).log('cycle-destroyed'); opts.container.removeData(); clean( opts.container[0], 'parsedAttrs', false ); // #75; remove inline styles if ( ! opts.retainStylesOnDestroy ) { opts.container.removeAttr( 'style' ); opts.slides.removeAttr( 'style' ); opts.slides.removeClass( opts.slideActiveClass ); } opts.slides.each(function() { var slide = $(this); slide.removeData(); slide.removeClass( opts.slideClass ); clean( this, 'parsedAttrs', false ); }); }, jump: function( index, fx ) { // go to the requested slide var fwd; var opts = this.opts(); if ( opts.busy && ! opts.manualTrump ) return; var num = parseInt( index, 10 ); if (isNaN(num) || num < 0 || num >= opts.slides.length) { opts.API.log('goto: invalid slide index: ' + num); return; } if (num == opts.currSlide) { opts.API.log('goto: skipping, already on slide', num); return; } opts.nextSlide = num; clearTimeout(opts.timeoutId); opts.timeoutId = 0; opts.API.log('goto: ', num, ' (zero-index)'); fwd = opts.currSlide < opts.nextSlide; opts._tempFx = fx; opts.API.prepareTx( true, fwd ); }, stop: function() { var opts = this.opts(); var pauseObj = opts.container; clearTimeout(opts.timeoutId); opts.timeoutId = 0; opts.API.stopTransition(); if ( opts.pauseOnHover ) { if ( opts.pauseOnHover !== true ) pauseObj = $( opts.pauseOnHover ); pauseObj.off('mouseenter mouseleave'); } opts.API.trigger('cycle-stopped', [ opts ]).log('cycle-stopped'); }, reinit: function() { var opts = this.opts(); opts.API.destroy(); opts.container.cycle(); }, remove: function( index ) { var opts = this.opts(); var slide, slideToRemove, slides = [], slideNum = 1; for ( var i=0; i < opts.slides.length; i++ ) { slide = opts.slides[i]; if ( i == index ) { slideToRemove = slide; } else { slides.push( slide ); $( slide ).data('cycle.opts').slideNum = slideNum; slideNum++; } } if ( slideToRemove ) { opts.slides = $( slides ); opts.slideCount--; $( slideToRemove ).remove(); if (index == opts.currSlide) opts.API.advanceSlide( 1 ); else if ( index < opts.currSlide ) opts.currSlide--; else opts.currSlide++; opts.API.trigger('cycle-slide-removed', [ opts, index, slideToRemove ]).log('cycle-slide-removed'); opts.API.updateView(); } } }); // listen for clicks on elements with data-cycle-cmd attribute $(document).on('click.cycle', '[data-cycle-cmd]', function(e) { // issue cycle command e.preventDefault(); var el = $(this); var command = el.data('cycle-cmd'); var context = el.data('cycle-context') || '.cycle-slideshow'; $(context).cycle(command, el.data('cycle-arg')); }); })(jQuery); /*! hash plugin for Cycle2; version: 20130905 */ (function($) { "use strict"; $(document).on( 'cycle-pre-initialize', function( e, opts ) { onHashChange( opts, true ); opts._onHashChange = function() { onHashChange( opts, false ); }; $( window ).on( 'hashchange', opts._onHashChange); }); $(document).on( 'cycle-update-view', function( e, opts, slideOpts ) { if ( slideOpts.hash && ( '#' + slideOpts.hash ) != window.location.hash ) { opts._hashFence = true; window.location.hash = slideOpts.hash; } }); $(document).on( 'cycle-destroyed', function( e, opts) { if ( opts._onHashChange ) { $( window ).off( 'hashchange', opts._onHashChange ); } }); function onHashChange( opts, setStartingSlide ) { var hash; if ( opts._hashFence ) { opts._hashFence = false; return; } hash = window.location.hash.substring(1); opts.slides.each(function(i) { if ( $(this).data( 'cycle-hash' ) == hash ) { if ( setStartingSlide === true ) { opts.startingSlide = i; } else { var fwd = opts.currSlide < i; opts.nextSlide = i; opts.API.prepareTx( true, fwd ); } return false; } }); } })(jQuery); /*! loader plugin for Cycle2; version: 20131121 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { loader: false }); $(document).on( 'cycle-bootstrap', function( e, opts ) { var addFn; if ( !opts.loader ) return; // override API.add for this slideshow addFn = opts.API.add; opts.API.add = add; function add( slides, prepend ) { var slideArr = []; if ( $.type( slides ) == 'string' ) slides = $.trim( slides ); else if ( $.type( slides) === 'array' ) { for (var i=0; i < slides.length; i++ ) slides[i] = $(slides[i])[0]; } slides = $( slides ); var slideCount = slides.length; if ( ! slideCount ) return; slides.css('visibility','hidden').appendTo('body').each(function(i) { // appendTo fixes #56 var count = 0; var slide = $(this); var images = slide.is('img') ? slide : slide.find('img'); slide.data('index', i); // allow some images to be marked as unimportant (and filter out images w/o src value) images = images.filter(':not(.cycle-loader-ignore)').filter(':not([src=""])'); if ( ! images.length ) { --slideCount; slideArr.push( slide ); return; } count = images.length; images.each(function() { // add images that are already loaded if ( this.complete ) { imageLoaded(); } else { $(this).load(function() { imageLoaded(); }).on("error", function() { if ( --count === 0 ) { // ignore this slide opts.API.log('slide skipped; img not loaded:', this.src); if ( --slideCount === 0 && opts.loader == 'wait') { addFn.apply( opts.API, [ slideArr, prepend ] ); } } }); } }); function imageLoaded() { if ( --count === 0 ) { --slideCount; addSlide( slide ); } } }); if ( slideCount ) opts.container.addClass('cycle-loading'); function addSlide( slide ) { var curr; if ( opts.loader == 'wait' ) { slideArr.push( slide ); if ( slideCount === 0 ) { // #59; sort slides into original markup order slideArr.sort( sorter ); addFn.apply( opts.API, [ slideArr, prepend ] ); opts.container.removeClass('cycle-loading'); } } else { curr = $(opts.slides[opts.currSlide]); addFn.apply( opts.API, [ slide, prepend ] ); curr.show(); opts.container.removeClass('cycle-loading'); } } function sorter(a, b) { return a.data('index') - b.data('index'); } } }); })(jQuery); /*! pager plugin for Cycle2; version: 20140415 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { pager: '> .cycle-pager', pagerActiveClass: 'cycle-pager-active', pagerEvent: 'click.cycle', pagerEventBubble: undefined, //pagerTemplate: '' pagerTemplate: '
  • ' }); $(document).on( 'cycle-bootstrap', function( e, opts, API ) { // add method to API API.buildPagerLink = buildPagerLink; }); $(document).on( 'cycle-slide-added', function( e, opts, slideOpts, slideAdded ) { if ( opts.pager ) { opts.API.buildPagerLink ( opts, slideOpts, slideAdded ); opts.API.page = page; } }); $(document).on( 'cycle-slide-removed', function( e, opts, index, slideRemoved ) { if ( opts.pager ) { var pagers = opts.API.getComponent( 'pager' ); pagers.each(function() { var pager = $(this); $( pager.children()[index] ).remove(); }); } }); $(document).on( 'cycle-update-view', function( e, opts, slideOpts ) { var pagers; if ( opts.pager ) { pagers = opts.API.getComponent( 'pager' ); pagers.each(function() { $(this).children().removeClass( opts.pagerActiveClass ) .eq( opts.currSlide ).addClass( opts.pagerActiveClass ); }); } }); $(document).on( 'cycle-destroyed', function( e, opts ) { var pager = opts.API.getComponent( 'pager' ); if ( pager ) { pager.children().off( opts.pagerEvent ); // #202 if ( opts.pagerTemplate ) pager.empty(); } }); function buildPagerLink( opts, slideOpts, slide ) { var pagerLink; var pagers = opts.API.getComponent( 'pager' ); pagers.each(function() { var pager = $(this); if ( slideOpts.pagerTemplate ) { var markup = opts.API.tmpl( slideOpts.pagerTemplate, slideOpts, opts, slide[0] ); pagerLink = $( markup ).appendTo( pager ); } else { pagerLink = pager.children().eq( opts.slideCount - 1 ); } pagerLink.on( opts.pagerEvent, function(e) { if ( ! opts.pagerEventBubble ) e.preventDefault(); opts.API.page( pager, e.currentTarget); }); }); } function page( pager, target ) { /*jshint validthis:true */ var opts = this.opts(); if ( opts.busy && ! opts.manualTrump ) return; var index = pager.children().index( target ); var nextSlide = index; var fwd = opts.currSlide < nextSlide; if (opts.currSlide == nextSlide) { return; // no op, clicked pager for the currently displayed slide } opts.nextSlide = nextSlide; opts._tempFx = opts.pagerFx; opts.API.prepareTx( true, fwd ); opts.API.trigger('cycle-pager-activated', [opts, pager, target ]); } })(jQuery); /*! prevnext plugin for Cycle2; version: 20140408 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { next: '> .cycle-next', nextEvent: 'click.cycle', disabledClass: 'disabled', prev: '> .cycle-prev', prevEvent: 'click.cycle', swipe: false }); $(document).on( 'cycle-initialized', function( e, opts ) { opts.API.getComponent( 'next' ).on( opts.nextEvent, function(e) { e.preventDefault(); opts.API.next(); }); opts.API.getComponent( 'prev' ).on( opts.prevEvent, function(e) { e.preventDefault(); opts.API.prev(); }); if ( opts.swipe ) { var nextEvent = opts.swipeVert ? 'swipeUp.cycle' : 'swipeLeft.cycle swipeleft.cycle'; var prevEvent = opts.swipeVert ? 'swipeDown.cycle' : 'swipeRight.cycle swiperight.cycle'; opts.container.on( nextEvent, function(e) { opts._tempFx = opts.swipeFx; opts.API.next(); }); opts.container.on( prevEvent, function() { opts._tempFx = opts.swipeFx; opts.API.prev(); }); } }); $(document).on( 'cycle-update-view', function( e, opts, slideOpts, currSlide ) { if ( opts.allowWrap ) return; var cls = opts.disabledClass; var next = opts.API.getComponent( 'next' ); var prev = opts.API.getComponent( 'prev' ); var prevBoundry = opts._prevBoundry || 0; var nextBoundry = (opts._nextBoundry !== undefined)?opts._nextBoundry:opts.slideCount - 1; if ( opts.currSlide == nextBoundry ) next.addClass( cls ).prop( 'disabled', true ); else next.removeClass( cls ).prop( 'disabled', false ); if ( opts.currSlide === prevBoundry ) prev.addClass( cls ).prop( 'disabled', true ); else prev.removeClass( cls ).prop( 'disabled', false ); }); $(document).on( 'cycle-destroyed', function( e, opts ) { opts.API.getComponent( 'prev' ).off( opts.nextEvent ); opts.API.getComponent( 'next' ).off( opts.prevEvent ); opts.container.off( 'swipeleft.cycle swiperight.cycle swipeLeft.cycle swipeRight.cycle swipeUp.cycle swipeDown.cycle' ); }); })(jQuery); /*! progressive loader plugin for Cycle2; version: 20130315 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { progressive: false }); $(document).on( 'cycle-pre-initialize', function( e, opts ) { if ( !opts.progressive ) return; var API = opts.API; var nextFn = API.next; var prevFn = API.prev; var prepareTxFn = API.prepareTx; var type = $.type( opts.progressive ); var slides, scriptEl; if ( type == 'array' ) { slides = opts.progressive; } else if ($.isFunction( opts.progressive ) ) { slides = opts.progressive( opts ); } else if ( type == 'string' ) { scriptEl = $( opts.progressive ); slides = $.trim( scriptEl.html() ); if ( !slides ) return; // is it json array? if ( /^(\[)/.test( slides ) ) { try { slides = $.parseJSON( slides ); } catch(err) { API.log( 'error parsing progressive slides', err ); return; } } else { // plain text, split on delimeter slides = slides.split( new RegExp( scriptEl.data('cycle-split') || '\n') ); // #95; look for empty slide if ( ! slides[ slides.length - 1 ] ) slides.pop(); } } if ( prepareTxFn ) { API.prepareTx = function( manual, fwd ) { var index, slide; if ( manual || slides.length === 0 ) { prepareTxFn.apply( opts.API, [ manual, fwd ] ); return; } if ( fwd && opts.currSlide == ( opts.slideCount-1) ) { slide = slides[ 0 ]; slides = slides.slice( 1 ); opts.container.one('cycle-slide-added', function(e, opts ) { setTimeout(function() { opts.API.advanceSlide( 1 ); },50); }); opts.API.add( slide ); } else if ( !fwd && opts.currSlide === 0 ) { index = slides.length-1; slide = slides[ index ]; slides = slides.slice( 0, index ); opts.container.one('cycle-slide-added', function(e, opts ) { setTimeout(function() { opts.currSlide = 1; opts.API.advanceSlide( -1 ); },50); }); opts.API.add( slide, true ); } else { prepareTxFn.apply( opts.API, [ manual, fwd ] ); } }; } if ( nextFn ) { API.next = function() { var opts = this.opts(); if ( slides.length && opts.currSlide == ( opts.slideCount - 1 ) ) { var slide = slides[ 0 ]; slides = slides.slice( 1 ); opts.container.one('cycle-slide-added', function(e, opts ) { nextFn.apply( opts.API ); opts.container.removeClass('cycle-loading'); }); opts.container.addClass('cycle-loading'); opts.API.add( slide ); } else { nextFn.apply( opts.API ); } }; } if ( prevFn ) { API.prev = function() { var opts = this.opts(); if ( slides.length && opts.currSlide === 0 ) { var index = slides.length-1; var slide = slides[ index ]; slides = slides.slice( 0, index ); opts.container.one('cycle-slide-added', function(e, opts ) { opts.currSlide = 1; opts.API.advanceSlide( -1 ); opts.container.removeClass('cycle-loading'); }); opts.container.addClass('cycle-loading'); opts.API.add( slide, true ); } else { prevFn.apply( opts.API ); } }; } }); })(jQuery); /*! tmpl plugin for Cycle2; version: 20121227 */ (function($) { "use strict"; $.extend($.fn.cycle.defaults, { tmplRegex: '{{((.)?.*?)}}' }); $.extend($.fn.cycle.API, { tmpl: function( str, opts /*, ... */) { var regex = new RegExp( opts.tmplRegex || $.fn.cycle.defaults.tmplRegex, 'g' ); var args = $.makeArray( arguments ); args.shift(); return str.replace(regex, function(_, str) { var i, j, obj, prop, names = str.split('.'); for (i=0; i < args.length; i++) { obj = args[i]; if ( ! obj ) continue; if (names.length > 1) { prop = obj; for (j=0; j < names.length; j++) { obj = prop; prop = prop[ names[j] ] || str; } } else { prop = obj[str]; } if ($.isFunction(prop)) return prop.apply(obj, args); if (prop !== undefined && prop !== null && prop != str) return prop; } return str; }); } }); })(jQuery); /*! carousel transition plugin for Cycle2; version: 20130528 */ (function($) { "use strict"; $( document ).on('cycle-bootstrap', function( e, opts, API ) { if ( opts.fx !== 'carousel' ) return; API.getSlideIndex = function( el ) { var slides = this.opts()._carouselWrap.children(); var i = slides.index( el ); return i % slides.length; }; // override default 'next' function API.next = function() { var count = opts.reverse ? -1 : 1; if ( opts.allowWrap === false && ( opts.currSlide + count ) > opts.slideCount - opts.carouselVisible ) return; opts.API.advanceSlide( count ); opts.API.trigger('cycle-next', [ opts ]).log('cycle-next'); }; }); $.fn.cycle.transitions.carousel = { // transition API impl preInit: function( opts ) { opts.hideNonActive = false; opts.container.on('cycle-destroyed', $.proxy(this.onDestroy, opts.API)); // override default API implementation opts.API.stopTransition = this.stopTransition; // issue #10 for (var i=0; i < opts.startingSlide; i++) { opts.container.append( opts.slides[0] ); } }, // transition API impl postInit: function( opts ) { var i, j, slide, pagerCutoffIndex, wrap; var vert = opts.carouselVertical; if (opts.carouselVisible && opts.carouselVisible > opts.slideCount) opts.carouselVisible = opts.slideCount - 1; var visCount = opts.carouselVisible || opts.slides.length; var slideCSS = { display: vert ? 'block' : 'inline-block', position: 'static' }; // required styles opts.container.css({ position: 'relative', overflow: 'hidden' }); opts.slides.css( slideCSS ); opts._currSlide = opts.currSlide; // wrap slides in a div; this div is what is animated wrap = $('') .prependTo( opts.container ) .css({ margin: 0, padding: 0, top: 0, left: 0, position: 'absolute' }) .append( opts.slides ); opts._carouselWrap = wrap; if ( !vert ) wrap.css('white-space', 'nowrap'); if ( opts.allowWrap !== false ) { // prepend and append extra slides so we don't see any empty space when we // near the end of the carousel. for fluid containers, add even more clones // so there is plenty to fill the screen // @todo: optimzie this based on slide sizes for ( j=0; j < (opts.carouselVisible === undefined ? 2 : 1); j++ ) { for ( i=0; i < opts.slideCount; i++ ) { wrap.append( opts.slides[i].cloneNode(true) ); } i = opts.slideCount; while ( i-- ) { // #160, #209 wrap.prepend( opts.slides[i].cloneNode(true) ); } } wrap.find('.cycle-slide-active').removeClass('cycle-slide-active'); opts.slides.eq(opts.startingSlide).addClass('cycle-slide-active'); } if ( opts.pager && opts.allowWrap === false ) { // hide "extra" pagers pagerCutoffIndex = opts.slideCount - visCount; $( opts.pager ).children().filter( ':gt('+pagerCutoffIndex+')' ).hide(); } opts._nextBoundry = opts.slideCount - opts.carouselVisible; this.prepareDimensions( opts ); }, prepareDimensions: function( opts ) { var dim, offset, pagerCutoffIndex, tmp, j; var vert = opts.carouselVertical; var visCount = opts.carouselVisible || opts.slides.length; if ( opts.carouselFluid && opts.carouselVisible ) { if ( ! opts._carouselResizeThrottle ) { // fluid container AND fluid slides; slides need to be resized to fit container this.fluidSlides( opts ); } } else if ( opts.carouselVisible && opts.carouselSlideDimension ) { dim = visCount * opts.carouselSlideDimension; opts.container[ vert ? 'height' : 'width' ]( dim ); } else if ( opts.carouselVisible ) { dim = visCount * $(opts.slides[0])[vert ? 'outerHeight' : 'outerWidth'](true); opts.container[ vert ? 'height' : 'width' ]( dim ); } // else { // // fluid; don't size the container // } offset = ( opts.carouselOffset || 0 ); if ( opts.allowWrap !== false ) { if ( opts.carouselSlideDimension ) { offset -= ( (opts.slideCount + opts.currSlide) * opts.carouselSlideDimension ); } else { // calculate offset based on actual slide dimensions tmp = opts._carouselWrap.children(); for (j=0; j < (opts.slideCount + opts.currSlide); j++) { offset -= $(tmp[j])[vert?'outerHeight':'outerWidth'](true); } } } opts._carouselWrap.css( vert ? 'top' : 'left', offset ); }, fluidSlides: function( opts ) { var timeout; var slide = opts.slides.eq(0); var adjustment = slide.outerWidth() - slide.width(); var prepareDimensions = this.prepareDimensions; // throttle resize event $(window).on( 'resize', resizeThrottle); opts._carouselResizeThrottle = resizeThrottle; onResize(); function resizeThrottle() { clearTimeout( timeout ); timeout = setTimeout( onResize, 20 ); } function onResize() { opts._carouselWrap.stop( false, true ); var slideWidth = opts.container.width() / opts.carouselVisible; slideWidth = Math.ceil( slideWidth - adjustment ); opts._carouselWrap.children().width( slideWidth ); if ( opts._sentinel ) opts._sentinel.width( slideWidth ); prepareDimensions( opts ); } }, // transition API impl transition: function( opts, curr, next, fwd, callback ) { var moveBy, props = {}; var hops = opts.nextSlide - opts.currSlide; var vert = opts.carouselVertical; var speed = opts.speed; // handle all the edge cases for wrapping & non-wrapping if ( opts.allowWrap === false ) { fwd = hops > 0; var currSlide = opts._currSlide; var maxCurr = opts.slideCount - opts.carouselVisible; if ( hops > 0 && opts.nextSlide > maxCurr && currSlide == maxCurr ) { hops = 0; } else if ( hops > 0 && opts.nextSlide > maxCurr ) { hops = opts.nextSlide - currSlide - (opts.nextSlide - maxCurr); } else if ( hops < 0 && opts.currSlide > maxCurr && opts.nextSlide > maxCurr ) { hops = 0; } else if ( hops < 0 && opts.currSlide > maxCurr ) { hops += opts.currSlide - maxCurr; } else currSlide = opts.currSlide; moveBy = this.getScroll( opts, vert, currSlide, hops ); opts.API.opts()._currSlide = opts.nextSlide > maxCurr ? maxCurr : opts.nextSlide; } else { if ( fwd && opts.nextSlide === 0 ) { // moving from last slide to first moveBy = this.getDim( opts, opts.currSlide, vert ); callback = this.genCallback( opts, fwd, vert, callback ); } else if ( !fwd && opts.nextSlide == opts.slideCount - 1 ) { // moving from first slide to last moveBy = this.getDim( opts, opts.currSlide, vert ); callback = this.genCallback( opts, fwd, vert, callback ); } else { moveBy = this.getScroll( opts, vert, opts.currSlide, hops ); } } props[ vert ? 'top' : 'left' ] = fwd ? ( "-=" + moveBy ) : ( "+=" + moveBy ); // throttleSpeed means to scroll slides at a constant rate, rather than // a constant speed if ( opts.throttleSpeed ) speed = (moveBy / $(opts.slides[0])[vert ? 'height' : 'width']() ) * opts.speed; opts._carouselWrap.animate( props, speed, opts.easing, callback ); }, getDim: function( opts, index, vert ) { var slide = $( opts.slides[index] ); return slide[ vert ? 'outerHeight' : 'outerWidth'](true); }, getScroll: function( opts, vert, currSlide, hops ) { var i, moveBy = 0; if (hops > 0) { for (i=currSlide; i < currSlide+hops; i++) moveBy += this.getDim( opts, i, vert); } else { for (i=currSlide; i > currSlide+hops; i--) moveBy += this.getDim( opts, i, vert); } return moveBy; }, genCallback: function( opts, fwd, vert, callback ) { // returns callback fn that resets the left/top wrap position to the "real" slides return function() { var pos = $(opts.slides[opts.nextSlide]).position(); var offset = 0 - pos[vert?'top':'left'] + (opts.carouselOffset || 0); opts._carouselWrap.css( opts.carouselVertical ? 'top' : 'left', offset ); callback(); }; }, // core API override stopTransition: function() { var opts = this.opts(); opts.slides.stop( false, true ); opts._carouselWrap.stop( false, true ); }, // core API supplement onDestroy: function( e ) { var opts = this.opts(); if ( opts._carouselResizeThrottle ) $( window ).off( 'resize', opts._carouselResizeThrottle ); opts.slides.prependTo( opts.container ); opts._carouselWrap.remove(); } }; })(jQuery); /*! tile transition plugin for Cycle2; version: 20140128 */ (function ($) { "use strict"; $.fn.cycle.transitions.tileSlide = $.fn.cycle.transitions.tileBlind = { before: function( opts, curr, next, fwd ) { opts.API.stackSlides( curr, next, fwd ); $(curr).css({ display: 'block', visibility: 'visible' }); opts.container.css('overflow', 'hidden'); // set defaults opts.tileDelay = opts.tileDelay || opts.fx == 'tileSlide' ? 100 : 125; opts.tileCount = opts.tileCount || 7; opts.tileVertical = opts.tileVertical !== false; if (!opts.container.data('cycleTileInitialized')) { opts.container.on('cycle-destroyed', $.proxy(this.onDestroy, opts.API)); opts.container.data('cycleTileInitialized', true); } }, transition: function( opts, curr, next, fwd, callback ) { opts.slides.not(curr).not(next).css('visibility','hidden'); var tiles = $(); var $curr = $(curr), $next = $(next); var tile, tileWidth, tileHeight, lastTileWidth, lastTileHeight, num = opts.tileCount, vert = opts.tileVertical, height = opts.container.height(), width = opts.container.width(); if ( vert ) { tileWidth = Math.floor(width / num); lastTileWidth = width - (tileWidth * (num - 1)); tileHeight = lastTileHeight = height; } else { tileWidth = lastTileWidth = width; tileHeight = Math.floor(height / num); lastTileHeight = height - (tileHeight * (num - 1)); } // opts.speed = opts.speed / 2; opts.container.find('.cycle-tiles-container').remove(); var animCSS; var tileCSS = { left: 0, top: 0, overflow: 'hidden', position: 'absolute', margin: 0, padding: 0 }; if ( vert ) { animCSS = opts.fx == 'tileSlide' ? { top: height } : { width: 0 }; } else { animCSS = opts.fx == 'tileSlide' ? { left: width } : { height: 0 }; } var tilesContainer = $('
    '); tilesContainer.css({ zIndex: $curr.css('z-index'), overflow: 'visible', position: 'absolute', top: 0, left: 0, direction: 'ltr' // #250 }); tilesContainer.insertBefore( next ); for (var i = 0; i < num; i++) { tile = $('
    ') .css( tileCSS ) .css({ width: ((num - 1 === i) ? lastTileWidth : tileWidth), height: ((num - 1 === i) ? lastTileHeight : tileHeight), marginLeft: vert ? ((i * tileWidth)) : 0, marginTop: vert ? 0 : (i * tileHeight) }) .append($curr.clone().css({ position: 'relative', maxWidth: 'none', width: $curr.width(), margin: 0, padding: 0, marginLeft: vert ? -(i * tileWidth) : 0, marginTop: vert ? 0 : -(i * tileHeight) })); tiles = tiles.add(tile); } tilesContainer.append(tiles); $curr.css('visibility','hidden'); $next.css({ opacity: 1, display: 'block', visibility: 'visible' }); animateTile(fwd ? 0 : num - 1); opts._tileAniCallback = function() { $next.css({ display: 'block', visibility: 'visible' }); $curr.css('visibility','hidden'); tilesContainer.remove(); callback(); }; function animateTile(i) { tiles.eq(i).animate( animCSS, { duration: opts.speed, easing: opts.easing, complete: function () { if (fwd ? (num - 1 === i) : (0 === i)) { opts._tileAniCallback(); } } }); setTimeout(function () { if (fwd ? (num - 1 !== i) : (0 !== i)) { animateTile(fwd ? (i + 1) : (i - 1)); } }, opts.tileDelay); } }, // tx API impl stopTransition: function( opts ) { opts.container.find('*').stop( true, true ); if (opts._tileAniCallback) opts._tileAniCallback(); }, // core API supplement onDestroy: function( e ) { var opts = this.opts(); opts.container.find('.cycle-tiles-container').remove(); } }; })(jQuery); /*! scrollVert transition plugin for Cycle2; version: 20140128 */ (function($) { "use strict"; $.fn.cycle.transitions.scrollVert = { before: function( opts, curr, next, fwd ) { opts.API.stackSlides( opts, curr, next, fwd ); var height = opts.container.css('overflow','hidden').height(); opts.cssBefore = { top: fwd ? -height : height, left: 0, opacity: 1, display: 'block', visibility: 'visible' }; opts.animIn = { top: 0 }; opts.animOut = { top: fwd ? height : -height }; } }; $.fn.cycle.transitions.scrollVertReverse = { before: function( opts, curr, next, fwd ) { opts.API.stackSlides( opts, curr, next, fwd ); var height = opts.container.css('overflow','hidden').height(); opts.cssBefore = { top: fwd ? height : -height, left: 0, opacity: 1, display: 'block', visibility: 'visible' }; opts.animIn = { top: 0 }; opts.animOut = { top: fwd ? -height : height }; } }; })(jQuery); /* jQuery - Easy Ticker - Plugin v2.0 www.aakashweb.com (c) 2014 Aakash Chakravarthy MIT License. */ ;(function($,h,i,j){var k="easyTicker",defaults={direction:'up',easing:'swing',speed:'slow',interval:2000,height:'auto',visible:0,mousePause:1,controls:{up:'',down:'',toggle:'',playText:'Play',stopText:'Stop'}};function EasyTicker(f,g){var s=this;s.opts=$.extend({},defaults,g);s.elem=$(f);s.targ=$(f).children(':first-child');s.timer=0;s.mHover=0;s.winFocus=1;init();start();$([h,i]).off('focus.jqet').on('focus.jqet',function(){s.winFocus=1}).off('blur.jqet').on('blur.jqet',function(){s.winFocus=0});if(s.opts.mousePause==1){s.elem.mouseenter(function(){s.timerTemp=s.timer;stop()}).mouseleave(function(){if(s.timerTemp!==0)start()})}$(s.opts.controls.up).on('click',function(e){e.preventDefault();moveDir('up')});$(s.opts.controls.down).on('click',function(e){e.preventDefault();moveDir('down')});$(s.opts.controls.toggle).on('click',function(e){e.preventDefault();if(s.timer==0)start();else stop()});function init(){s.elem.children().css('margin',0).children().css('margin',0);s.elem.css({position:'relative',height:s.opts.height,overflow:'hidden'});s.targ.css({'position':'absolute','margin':0});setInterval(function(){adjHeight()},100)}function start(){s.timer=setInterval(function(){if(s.winFocus==1){move(s.opts.direction)}},s.opts.interval);$(s.opts.controls.toggle).addClass('et-run').html(s.opts.controls.stopText)}function stop(){clearInterval(s.timer);s.timer=0;$(s.opts.controls.toggle).removeClass('et-run').html(s.opts.controls.playText)}function move(a){var b,eq,appType;if(!s.elem.is(':visible'))return;if(a=='up'){b=':first-child';eq='-=';appType='appendTo'}else{b=':last-child';eq='+=';appType='prependTo'}var c=s.targ.children(b);var d=c.outerHeight();s.targ.stop(true,true).animate({'top':eq+d+"px"},s.opts.speed,s.opts.easing,function(){c.hide()[appType](s.targ).fadeIn();s.targ.css('top',0);adjHeight()})}function moveDir(a){stop();if(a=='up')move('up');else move('down')}function fullHeight(){var a=0;var b=s.elem.css('display');s.elem.css('display','block');s.targ.children().each(function(){a+=$(this).outerHeight()});s.elem.css({'display':b,'height':a})}function visHeight(a){var b=0;s.targ.children(':lt('+s.opts.visible+')').each(function(){b+=$(this).outerHeight()});if(a==1){s.elem.stop(true,true).animate({height:b},s.opts.speed)}else{s.elem.css('height',b)}}function adjHeight(){if(s.opts.height=='auto'&&s.opts.visible!=0){anim=arguments.callee.caller.name=='init'?0:1;visHeight(anim)}else if(s.opts.height=='auto'){fullHeight()}}return{up:function(){moveDir('up')},down:function(){moveDir('down')},start:start,stop:stop,options:s.opts}}$.fn[k]=function(a){return this.each(function(){if(!$.data(this,k)){$.data(this,k,new EasyTicker(this,a))}})}})(jQuery,window,document); // Generated by CoffeeScript 1.6.1 (function() { (function($, window, document) { var Plugin, defaults, pluginName; pluginName = "slidesjs"; defaults = { width: 940, height: 528, start: 1, navigation: { active: true, effect: "slide" }, pagination: { active: true, effect: "slide" }, play: { active: false, effect: "slide", interval: 5000, auto: false, swap: true, pauseOnHover: false, restartDelay: 2500 }, effect: { slide: { speed: 500 }, fade: { speed: 300, crossfade: true } }, callback: { loaded: function() {}, start: function() {}, complete: function() {} } }; Plugin = (function() { function Plugin(element, options) { this.element = element; this.options = $.extend(true, {}, defaults, options); this._defaults = defaults; this._name = pluginName; this.init(); } return Plugin; })(); Plugin.prototype.init = function() { var $element, nextButton, pagination, playButton, prevButton, stopButton, _this = this; $element = $(this.element); this.data = $.data(this); $.data(this, "animating", false); $.data(this, "total", $element.children().not(".slidesjs-navigation", $element).length); $.data(this, "current", this.options.start - 1); $.data(this, "vendorPrefix", this._getVendorPrefix()); if (typeof TouchEvent !== "undefined") { $.data(this, "touch", true); this.options.effect.slide.speed = this.options.effect.slide.speed / 2; } $element.css({ overflow: "hidden" }); $element.slidesContainer = $element.children().not(".slidesjs-navigation", $element).wrapAll("
    ", $element).parent().css({ overflow: "hidden", position: "relative" }); $(".slidesjs-container", $element).wrapInner("
    ", $element).children(); $(".slidesjs-control", $element).css({ position: "relative", left: 0 }); $(".slidesjs-control", $element).children().addClass("slidesjs-slide").css({ position: "absolute", top: 0, left: 0, width: "100%", zIndex: 0, display: "none", webkitBackfaceVisibility: "hidden" }); $.each($(".slidesjs-control", $element).children(), function(i) { var $slide; $slide = $(this); return $slide.attr("slidesjs-index", i); }); if (this.data.touch) { $(".slidesjs-control", $element).on("touchstart", function(e) { return _this._touchstart(e); }); $(".slidesjs-control", $element).on("touchmove", function(e) { return _this._touchmove(e); }); $(".slidesjs-control", $element).on("touchend", function(e) { return _this._touchend(e); }); } $element.fadeIn(0); this.update(); if (this.data.touch) { this._setuptouch(); } $(".slidesjs-control", $element).children(":eq(" + this.data.current + ")").eq(0).fadeIn(0, function() { return $(this).css({ zIndex: 10 }); }); if (this.options.navigation.active) { prevButton = $("", { "class": "slidesjs-previous slidesjs-navigation", href: "#", title: "Previous", text: "Previous" }).appendTo($element); nextButton = $("", { "class": "slidesjs-next slidesjs-navigation", href: "#", title: "Next", text: "Next" }).appendTo($element); } $(".slidesjs-next", $element).click(function(e) { e.preventDefault(); _this.stop(true); return _this.next(_this.options.navigation.effect); }); $(".slidesjs-previous", $element).click(function(e) { e.preventDefault(); _this.stop(true); return _this.previous(_this.options.navigation.effect); }); if (this.options.play.active) { playButton = $("", { "class": "slidesjs-play slidesjs-navigation", href: "#", title: "Play", text: "Play" }).appendTo($element); stopButton = $("", { "class": "slidesjs-stop slidesjs-navigation", href: "#", title: "Stop", text: "Stop" }).appendTo($element); playButton.click(function(e) { e.preventDefault(); return _this.play(true); }); stopButton.click(function(e) { e.preventDefault(); return _this.stop(true); }); if (this.options.play.swap) { stopButton.css({ display: "none" }); } } if (this.options.pagination.active) { pagination = $("