").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
/*! jQuery Migrate v1.2.1 | (c) 2005, 2013 jQuery Foundation, Inc. and other contributors | jquery.org/license */
jQuery.migrateMute===void 0&&(jQuery.migrateMute=!0),function(e,t,n){function r(n){var r=t.console;i[n]||(i[n]=!0,e.migrateWarnings.push(n),r&&r.warn&&!e.migrateMute&&(r.warn("JQMIGRATE: "+n),e.migrateTrace&&r.trace&&r.trace()))}function a(t,a,i,o){if(Object.defineProperty)try{return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){return r(o),i},set:function(e){r(o),i=e}}),n}catch(s){}e._definePropertyBroken=!0,t[a]=i}var i={};e.migrateWarnings=[],!e.migrateMute&&t.console&&t.console.log&&t.console.log("JQMIGRATE: Logging is active"),e.migrateTrace===n&&(e.migrateTrace=!0),e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===document.compatMode&&r("jQuery is not compatible with Quirks Mode");var o=e("",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr( props, pass ) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
/*
* jQuery Related Selects plug-in 1.0
*
* http://www.erichynds.com/jquery/jquery-related-dependent-selects-plugin/
* http://github.com/ehynds/jquery-related-selects
*
* Copyright (c) 2009 Eric Hynds
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
(function(d){d.fn.relatedSelects=function(j){j=d.extend({},d.fn.relatedSelects.defaults,j);return this.each(function(){new q(this,j)})};var q=function(j,h){function r(){for(var b,a,c=1,f=g.length;c0&&e!==f.loadingMessage&&a){n(c);s(b,a,f)}else a&&n(c)}}function s(b,a,c){var f=[],e=[];e=0;for(var t=g.length;e'+c.loadingMessage+"");d.ajax({beforeSend:function(){c.onLoadingStart.call(a)},complete:function(){c.onLoadingEnd.call(a)},dataType:c.dataType,data:e,url:c.onChangeLoad,success:function(l){var i=[],o=a.data("defaultOption");o.length>0&&i.push('");if(c.dataType==="json"&&typeof l==="object"&&l){d.each(l,function(u,v){i.push('")});a.html(i.join("")).removeAttr("disabled")}else if(c.dataType==="html"&&d.trim(l).length>0){i.push(d.trim(l));a.html(i.join("")).removeAttr("disabled")}else{a.html(i.join(""));c.disableIfEmpty||a.removeAttr("disabled");c.onEmptyResult.call(b)}}})}function w(b){b=b.find("option");return b.length===0||b.length===1&&b.filter(":first").attr("value").length===0?false:true}function n(b){b=p(b)+1;for(var a=g.length;b0&&w(f)||m(c,f,b,a)})};d.fn.relatedSelects.defaults={selects:{},loadingMessage:"Loading, please wait...",disableIfEmpty:false,dataType:"json",onChangeLoad:"",onLoadingStart:function(){},onLoadingEnd:function(){},onChange:function(){},onEmptyResult:function(){}}})(jQuery);
/*! IMPORTANT : jQuery Validation Plugin : mis dans global-fr.js et global-us pour gérer les traductions
*/
// provides cross-browser focusin and focusout events
// IE has native support, in other browsers, use event caputuring (neither bubbles)
// provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target
(function($) {
// only implement if not provided by jQuery core (since 1.4)
// TODO verify if jQuery 1.4's implementation is compatible with older jQuery special-event APIs
if (!jQuery.event.special.focusin && !jQuery.event.special.focusout && document.addEventListener) {
$.each({
focus: 'focusin',
blur: 'focusout'
}, function( original, fix ){
$.event.special[fix] = {
setup:function() {
this.addEventListener( original, handler, true );
},
teardown:function() {
this.removeEventListener( original, handler, true );
},
handler: function(e) {
var args = arguments;
args[0] = $.event.fix(e);
args[0].type = fix;
return $.event.handle.apply(this, args);
}
};
function handler(e) {
e = $.event.fix(e);
e.type = fix;
return $.event.handle.call(this, e);
}
});
}
$.extend($.fn, {
validateDelegate: function(delegate, type, handler) {
return this.bind(type, function(event) {
var target = $(event.target);
if (target.is(delegate)) {
return handler.apply(target, arguments);
}
});
}
});
}(jQuery));
/* fonction de modale basique développée par Nico @Ndup
parce qu'il y en marre des plugins non maintenus ou qui ne fonctionne pas
pour afficher une modale, utiliser le markup suivant :
");i.html(k.join(""))}i.trigger("reposition");f.apply(h);return d.isInFocus.apply(h,[j.degrees])},setBearing:function(b,c){c=c||function(){};b=d.normalize.apply(null,[b]);this.each(function(){var c,e,f,g=a(this),h=g.data("roundabout"),i=h.bearing;h.bearing=b;g.trigger("bearingSet");d.updateChildren.apply(g);c=Math.abs(i-b);if(!h.animating||c>180)return;c=Math.abs(i-b);g.children(h.childSelector).each(function(c){var e;if(d.isChildBackDegreesBetween.apply(a(this),[b,i])){e=i>b?"Clockwise":"Counterclockwise";a(this).trigger("move"+e+"ThroughBack")}})});c.apply(this);return this},adjustBearing:function(b,c){c=c||function(){};if(b===0)return this;this.each(function(){d.setBearing.apply(a(this),[a(this).data("roundabout").bearing+b])});c.apply(this);return this},setTilt:function(b,c){c=c||function(){};this.each(function(){a(this).data("roundabout").tilt=b;d.updateChildren.apply(a(this))});c.apply(this);return this},adjustTilt:function(b,c){c=c||function(){};this.each(function(){d.setTilt.apply(a(this),[a(this).data("roundabout").tilt+b])});c.apply(this);return this},animateToBearing:function(b,c,e,f,g){var h=(new Date).getTime();g=g||function(){};if(a.isFunction(f)){g=f;f=null}else if(a.isFunction(e)){g=e;e=null}else if(a.isFunction(c)){g=c;c=null}this.each(function(){var i,j,k,l=a(this),m=l.data("roundabout"),n=c?c:m.duration,o=e?e:m.easing||"swing";f||(f={timerStart:h,start:m.bearing,totalTime:n});i=h-f.timerStart;if(m.stopAnimation){d.allowAnimation.apply(l);m.animating=!1;return}if(i=0&&(k=f.start+(b-f.start)*k);k=d.normalize.apply(null,[k]);m.dragBearing=k;d.setBearing.apply(l,[k,function(){setTimeout(function(){d.animateToBearing.apply(l,[b,n,o,f,g])},0)}])}else{m.lastAnimationStep=!0;b=d.normalize.apply(null,[b]);d.setBearing.apply(l,[b,function(){l.trigger("animationEnd")}]);m.animating=!1;m.lastAnimationStep=!1;m.dragBearing=b;g.apply(l)}});return this},animateToNearbyChild:function(b,c){var e=b[0],f=b[1],g=b[2]||function(){};if(a.isFunction(f)){g=f;f=null}else if(a.isFunction(e)){g=e;e=null}return this.each(function(){var b,h,i=a(this),j=i.data("roundabout"),k=j.reflect?j.bearing:j.bearing%360,l=i.children(j.childSelector).length;if(!j.animating)if(j.reflect&&c==="previous"||!j.reflect&&c==="next"){k=Math.abs(k)=Math.floor(h.lower)){l===2&&k===360?d.animateToDelta.apply(i,[-180,e,f,g]):d.animateBearingToFocus.apply(i,[h.lower,e,f,g]);break}}}else{k=Math.abs(k)=0;b-=1){h={lower:j.period*b,upper:j.period*(b+1)};h.upper=b===l-1?360:h.upper;if(k>=Math.floor(h.lower)&&k180?-(360-g):g;g!==0&&d.animateToDelta.apply(a(this),[g,c,e,f])})},stopAnimation:function(){return this.each(function(){a(this).data("roundabout").stopAnimation=!0})},allowAnimation:function(){return this.each(function(){a(this).data("roundabout").stopAnimation=!1})},startAutoplay:function(b){return this.each(function(){var c=a(this),e=c.data("roundabout");b=b||e.autoplayCallback||function(){};clearInterval(e.autoplayInterval);e.autoplayInterval=setInterval(function(){d.animateToNextChild.apply(c,[b])},e.autoplayDuration);e.autoplayIsRunning=!0;c.trigger("autoplayStart")})},stopAutoplay:function(b){return this.each(function(){clearInterval(a(this).data("roundabout").autoplayInterval);a(this).data("roundabout").autoplayInterval=null;a(this).data("roundabout").autoplayIsRunning=!1;b||a(this).unbind(".autoplay");a(this).trigger("autoplayStop")})},toggleAutoplay:function(b){return this.each(function(){var c=a(this),e=c.data("roundabout");b=b||e.autoplayCallback||function(){};d.isAutoplaying.apply(a(this))?d.stopAutoplay.apply(a(this),[b]):d.startAutoplay.apply(a(this),[b])})},isAutoplaying:function(){return this.data("roundabout").autoplayIsRunning},changeAutoplayDuration:function(b){return this.each(function(){var c=a(this),e=c.data("roundabout");e.autoplayDuration=b;if(d.isAutoplaying.apply(c)){d.stopAutoplay.apply(c);setTimeout(function(){d.startAutoplay.apply(c)},10)}})},normalize:function(a){var b=a%360;return b<0?360+b:b},normalizeRad:function(a){while(a<0)a+=Math.PI*2;while(a>Math.PI*2)a-=Math.PI*2;return a},isChildBackDegreesBetween:function(b,c){var d=a(this).data("roundabout").backDegrees;return b>c?d>=c&&d=b},getAnimateToMethod:function(a){a=a.toLowerCase();return a==="next"?"animateToNextChild":a==="previous"?"animateToPreviousChild":"animateToNearestChild"},relayoutChildren:function(){return this.each(function(){var b=a(this),c=a.extend({},b.data("roundabout"));c.startingChild=b.data("roundabout").childInFocus;d.init.apply(b,[c,null,!0])})},getNearestChild:function(){var b=a(this),c=b.data("roundabout"),d=b.children(c.childSelector).length;return c.reflect?Math.round(c.bearing/c.period)%d:(d-Math.round(c.bearing/c.period)%d)%d},degToRad:function(a){return d.normalize.apply(null,[a])*Math.PI/180},getPlacement:function(a){var b=this.data("roundabout");return b.reflect?b.period*a:360-b.period*a},isInFocus:function(a){var b,c=this,e=c.data("roundabout"),f=d.normalize.apply(null,[e.bearing]);a=d.normalize.apply(null,[a]);b=Math.abs(f-a);return b<=e.floatComparisonThreshold||b>=360-e.floatComparisonThreshold},getChildInFocus:function(){var b=a(this).data("roundabout");return b.childInFocus>-1?b.childInFocus:!1},compareVersions:function(a,b){var c,d=a.split(/\./i),e=b.split(/\./i),f=d.length>e.length?d.length:e.length;for(c=0;c<=f;c++){if(d[c]&&!e[c]&&parseInt(d[c],10)!==0)return 1;if(e[c]&&!d[c]&&parseInt(e[c],10)!==0)return-1;if(d[c]===e[c])continue;if(d[c]&&e[c])return parseInt(d[c],10)>parseInt(e[c],10)?1:-1}return 0}};a.fn.roundabout=function(b){if(d[b])return d[b].apply(this,Array.prototype.slice.call(arguments,1));if(typeof b=="object"||a.isFunction(b)||!b)return d.init.apply(this,arguments);a.error("Method "+b+" does not exist for jQuery.roundabout.")}})(jQuery);
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2006, 2014 Klaus Hartl
* Released under the MIT license
*/
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// CommonJS
factory(require('jquery'));
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
var pluses = /\+/g;
function encode(s) {
return config.raw ? s : encodeURIComponent(s);
}
function decode(s) {
return config.raw ? s : decodeURIComponent(s);
}
function stringifyCookieValue(value) {
return encode(config.json ? JSON.stringify(value) : String(value));
}
function parseCookieValue(s) {
if (s.indexOf('"') === 0) {
// This is a quoted cookie as according to RFC2068, unescape...
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
}
try {
// Replace server-side written pluses with spaces.
// If we can't decode the cookie, ignore it, it's unusable.
// If we can't parse the cookie, ignore it, it's unusable.
s = decodeURIComponent(s.replace(pluses, ' '));
return config.json ? JSON.parse(s) : s;
} catch(e) {}
}
function read(s, converter) {
var value = config.raw ? s : parseCookieValue(s);
return $.isFunction(converter) ? converter(value) : value;
}
var config = $.cookie = function (key, value, options) {
// Write
if (arguments.length > 1 && !$.isFunction(value)) {
options = $.extend({}, config.defaults, options);
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setTime(+t + days * 864e+5);
}
return (document.cookie = [
encode(key), '=', stringifyCookieValue(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(''));
}
// Read
var result = key ? undefined : {};
// To prevent the for loop in the first place assign an empty array
// in case there are no cookies at all. Also prevents odd result when
// calling $.cookie().
var cookies = document.cookie ? document.cookie.split('; ') : [];
for (var i = 0, l = cookies.length; i < l; i++) {
var parts = cookies[i].split('=');
var name = decode(parts.shift());
var cookie = parts.join('=');
if (key && key === name) {
// If second argument (value) is a function it's a converter...
result = read(cookie, value);
break;
}
// Prevent storing a cookie that we couldn't decode.
if (!key && (cookie = read(cookie)) !== undefined) {
result[name] = cookie;
}
}
return result;
};
config.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key) === undefined) {
return false;
}
// Must not alter options, thus extending a fresh object...
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
return !$.cookie(key);
};
}));
// Magnific Popup v1.0.0 by Dmitry Semenov > déplacer dans global-us.js et global-fr.js pour gérer la trad
(function($){
$(document).ready(function(){
$(window).on('updateSVGItem', function(e, item){
if(item === undefined){
$('.svg').each(function(){
generateSVG($(this));
});
}else{
generateSVG(item);
}
});
$('.svg').each(function(){
generateSVG($(this));
});
header();
});
function generateSVG(item){
var img = $(item);
var imgID = img.attr('id');
var imgClass = img.attr('class');
var imgURL = img.attr('src');
$.get(imgURL, function(data) {
// Get the SVG tag, ignore the rest
var svg = $(data).find('svg');
// Add replaced image's ID to the new SVG
if(typeof imgID !== 'undefined') {
svg = svg.attr('id', imgID);
}
// Add replaced image's classes to the new SVG
if(typeof imgClass !== 'undefined') {
svg = svg.attr('class', imgClass+' replaced-svg');
}
// Remove any invalid XML tags as per http://validator.w3.org
svg = svg.removeAttr('xmlns:a');
// Replace image with new SVG
img.replaceWith(svg);
}, 'xml');
}
function header (){
var btn_menu_full = $('#show_menu_full');
var btn_fermer_full = $('#close_menu_full');
var le_menu_full = $('#menu_full');
btn_menu_full.click(function () {
le_menu_full.toggle();
});
btn_fermer_full.click(function () {
le_menu_full.toggle();
});
if ($(window).width() < 980) {
$('#menu_full .sub > a').click(function (e) {
e.preventDefault();
console.log('click sur menu avec sousrubs');
var toto = $(this).parent().find('.sousrubs');
console.log(toto);
if (!toto.is(':visible')) {
//toto.css('display','block!important');
toto.addClass('much_block');
console.log('afficher toto');
}
else {
//toto.css('display','none');
toto.removeClass('much_block');
console.log('masquer toto');
}
});
}
// var btn_menu = $('#show_menu');
// var le_menu = $('#menu');
// btn_menu.click(function () {
// le_menu.toggle();
// });
//
// if ($(window).width() <= 980) {
// $('#menu .sub > a').click(function (e) {
// e.preventDefault();
// console.log('click sur menu avec sousrubs');
// var toto = $(this).parent().find('.sousrubs');
// console.log(toto);
// if (!toto.is(':visible')) {
// //toto.css('display','block!important');
// toto.addClass('much_block');
// console.log('afficher toto');
// }
// else {
// //toto.css('display','none');
// toto.removeClass('much_block');
// console.log('masquer toto');
// }
// });
// }
var bfs_flick_mob = false;
// si on est sur un petit écran et qu'on veut flickity
if ($(document).width() < 640 && bfs_flick_mob == true) {
var flkty = new Flickity('.les_blocs_film', {
freeScroll: true,
autoPlay: 3000,
wrapAround: true,
imagesLoaded: true
});
}
groupFilmTabs();
mobileMenu();
stickyHeader();
// les boutons
// var bfs_btn_sem = $('#bfs_show_sem');
// var bfs_btn_proch = $('#bfs_show_proch');
// var bfs_btns = $('.bfs_btn');
// var bfs_btns_svg = $('.bfs_btn svg');
// // les blocs films
// var blocs_films = $('.bloc_film');
// var bloc_sem = $('.filmsem');
// var bloc_proch = $('.filmproch');
// var with_flick = false
//
// // fonction pour afficher ou masquer des films et sélectionner le bon menu
// function tri_films(to_show=false, to_sel=false) {
// // si on a des films demandés
// if (to_show) {
// // on masque tous les blocs
// blocs_films.addClass('nope');
// // on supprime la class de filtre
// blocs_films.removeClass('flck');
// // on affiche ceux de la semaine
// to_show.removeClass('nope');
// to_show.addClass('flck');
// }
// else {
// // on affiche tous les blocs
// blocs_films.removeClass('nope');
// // on ajoute la class de filtre
// blocs_films.addClass('flck');
// }
// // on déselectionne les boutons
// bfs_btns.removeClass('sel');
// // on sélectionne celui-là
// to_sel.addClass('sel');
// // si c'est du mobile
// if ($(document).width() < 640) {
// fl_reload();
// }
// }
function fl_reload() {
// s'il n'y a pas flickity, pas besoin de recharger
if (!with_flick) {
return;
}
// il y a flickity sur les films donc il faut refresh, on destroy
flkty.destroy();
// on filtre sur les images
flkty = new Flickity('.les_blocs_film', {
contain: true,
cellAlign: 'left',
freeScroll: true,
autoPlay: 3000,
wrapAround: false,
imagesLoaded: true,
cellSelector: '.flck'
});
// TODO : fixer le bug de quand on navigue puis retrie qui casse le nouveau flickity
}
// si on veut les films de la semaine
// bfs_btn_sem.click(function (e) {
// e.preventDefault();
// tri_films(bloc_sem, $(this));
// });
// // si on veut les films prochainement
// bfs_btn_proch.click(function (e) {
// e.preventDefault();
// tri_films(bloc_proch, $(this));
// });
//
// // par défaut on affiche les films de la semaine
// bfs_btn_sem.trigger('click');
}
function stickyHeader(){
var options = {
header_container: null,
header: null,
$header_container_base_padding: 0,
$header_height: 0,
$header_offset_top: 0
};
main();
function main(){
options.header_container = $('#masthead');
options.header = $('#header');
calculateData();
handlers();
}
function handlers(){
$(window).on('scroll', function(){
let _scroll = $(window).scrollTop();
if(_scroll > options.$header_offset_top){
stickHeader();
}else{
unStickHeader();
}
});
$(window).on('resize', function(){
calculateData();
});
}
function calculateData(){
options.$header_offset_top = options.header_container.offset().top;
options.$header_height = options.header[0].clientHeight;
options.header_container.removeAttr('style');
options.$header_container_base_padding = parseInt(options.header_container.css('padding-top'));
if($(window).scrollTop() > options.$header_offset_top) {
stickHeader();
}
}
function stickHeader(){
options.header.addClass('sticky');
options.header_container.css('padding-top', options.$header_height + options.$header_container_base_padding);
}
function unStickHeader(){
options.header.removeClass('sticky');
options.header_container.css('padding-top', options.$header_container_base_padding);
}
}
function groupFilmTabs(){
var options = {}
main();
function main(){
options.buttons = $('.group-tab-button');
options.content = $('.group-film-content');
changeTab(1);
handlers();
}
function handlers(){
options.buttons.on('click', function(){
changeTab($(this).data('tab'));
});
}
function changeTab(index){
options.buttons.removeClass('active');
$('.group-tab-button[data-tab="'+index+'"]').addClass('active');
options.content.removeClass('active');
$('.group-film-content[data-tab="'+index+'"]').addClass('active');
}
}
function mobileMenu(){
var options = {
button: null,
menu: null,
close: null
};
main();
function main(){
options.menu = $('#top');
options.button = options.menu.find('.mobile-more-link');
options.close = options.menu.find('.close');
handlers();
}
function handlers(){
options.button.on('click', function(){
if(options.menu.is('.active')){
menuHide();
}else{
menuShow();
}
});
$(window).resize(function(){
if($(window).width() > 980){
menuHide();
}
});
options.close.on('click', function(){
menuHide();
});
}
function menuHide(){
options.menu.removeClass('active');
}
function menuShow(){
options.menu.addClass('active');
}
}
})(jQuery);