/** * -------------------------------------------------------------------------- * loading * -------------------------------------------------------------------------- */ + function ($) { $(window).bind("load", function() { $('#modal-steps').modalSteps(); // rest of the function body remains the same: // public loading $("body").removeClass("d-none"); if ($('body').hasClass("pg-liquid") === true) { $(".hd-nav").addClass("absolute-top"); $('.main-navbar').removeClass("navbar-light").addClass("navbar-dark"); if ($('.pg-liquid').hasClass("white") === true) { $('.main-navbar').removeClass("navbar-dark").addClass("navbar-light"); } if ($('.pg-liquid').hasClass("d-light") === true) { $('.main-navbar').removeClass("navbar-dark").addClass("navbar-light"); } } if ($('body').hasClass("is-loading") === true) { $('body').addClass('in'); // $(".pg-liquid .hd-nav").addClass("absolute-top"); setTimeout(function() { $('body').removeClass('is-loading').removeClass('in'); $('body').addClass('loaded'); }, 800); } if ($(".footer").hasClass("footer-fixed") === true ) { $(".content").addClass("content-bottom") } }); }(jQuery); + function ($) { $(document).ready(function() { // // Detect browser and insert name // -------------------------------------------------- var isOpera = !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera) var isFirefox = typeof InstallTrigger !== 'undefined'; // Firefox 1.0+ var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; // At least Safari 3+: "[object HTMLElementConstructor]" var isChrome = !!window.chrome && !isOpera; // Chrome 1+ var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6 var browserId = $('.outdated-browser-id'); if (isIE){ browserId.text("Internet Explorer"); } else if (isOpera){ browserId.text("Opera"); } else if (isFirefox){ browserId.text("Firefox"); } else if (isChrome){ browserId.text("Google Chrome"); } else if (isSafari){ browserId.text("Safari"); } else{ browserId.text("browser"); } }); }(jQuery); $(document).ready(function(){ 'use strict'; // if ($(".ft-main").hasClass("fixed-bottom") === true ) { // $(".bd-mosaic").addClass("mb"); // } // START OF: Navigation ===== // Open menu var container = $('#menu-nav, .navbar-backdrop'); $('.navbar-backdrop, #menu-button-open, #menu-button-close').on("click", function(e) { if ($(container).hasClass("in")) { $(container).removeClass('in'); $(container).addClass('out'); } else { $(container).removeClass('out'); $(container).addClass('in'); } }); // ===== END OF: Navigation // START OF: info dismiss $("[data-dismiss=info-navbar-close]").on("click", function(){ $("body").removeClass("info-navbar-open"); setTimeout(function() { $('.info-navbar').remove(); }, 800); }); // ===== END OF: info dismiss }); /* ======================================================================== * Bootstrap: affix.js v3.3.6 * http://getbootstrap.com/javascript/#affix * ======================================================================== * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) * ======================================================================== */ + function ($) { 'use strict'; // AFFIX CLASS DEFINITION // ====================== var Affix = function (element, options) { this.options = $.extend({}, Affix.DEFAULTS, options); this.$target = $(this.options.target) .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) .on('click.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)); this.$element = $(element); this.affixed = null; this.unpin = null; this.pinnedOffset = null; this.checkPosition(); }; Affix.VERSION = '3.3.6'; Affix.RESET = 'affix affix-top affix-bottom'; Affix.DEFAULTS = { offset: 0, target: window }; Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { var scrollTop = this.$target.scrollTop(); var position = this.$element.offset(); var targetHeight = this.$target.height(); if (offsetTop !== null && this.affixed === 'top') { return scrollTop < offsetTop ? 'top' : false; } if (this.affixed === 'bottom') { if (offsetTop !== null) { return scrollTop + this.unpin <= position.top ? false : 'bottom'; } { return scrollTop + targetHeight <= scrollHeight - offsetBottom ? false : 'bottom'; } } var initializing = this.affixed === null; var colliderTop = initializing ? scrollTop : position.top; var colliderHeight = initializing ? targetHeight : height; if (offsetTop !== null && scrollTop <= offsetTop) {return 'top';} if (offsetBottom !== null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) {return 'bottom';} return false; }; Affix.prototype.getPinnedOffset = function () { if (this.pinnedOffset) {return this.pinnedOffset;} this.$element.removeClass(Affix.RESET).addClass('affix'); var scrollTop = this.$target.scrollTop(); var position = this.$element.offset(); {return (this.pinnedOffset = position.top - scrollTop);} }; Affix.prototype.checkPositionWithEventLoop = function () { setTimeout($.proxy(this.checkPosition, this), 1); }; Affix.prototype.checkPosition = function () { if (!this.$element.is(':visible')) {return;} var height = this.$element.height(); var offset = this.options.offset; var offsetTop = offset.top; var offsetBottom = offset.bottom; var scrollHeight = Math.max($(document).height(), $(document.body).height()); if (typeof offset !== 'object') {offsetBottom = offsetTop = offset;} if (typeof offsetTop === 'function') {offsetTop = offset.top(this.$element);} if (typeof offsetBottom === 'function') {offsetBottom = offset.bottom(this.$element);} var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom); if (this.affixed !== affix) { if (this.unpin !== null) {this.$element.css('top', '');} var affixType = 'affix' + (affix ? '-' + affix : ''); var e = $.Event(affixType + '.affix'); this.$element.trigger(e); if (e.isDefaultPrevented()) {return;} this.affixed = affix; this.unpin = affix === 'bottom' ? this.getPinnedOffset() : null; this.$element .removeClass(Affix.RESET) .addClass(affixType) .trigger(affixType.replace('affix', 'affixed') + '.affix'); } if (affix === 'bottom') { this.$element.offset({ top: scrollHeight - height - offsetBottom }); } }; // AFFIX PLUGIN DEFINITION // ======================= function Plugin(option) { return this.each(function () { var $this = $(this); var data = $this.data('.affix'); var options = typeof option === 'object' && option; if (!data) {$this.data('.affix', data = new Affix(this, options));} if (typeof option === 'string') {data[option]();} }); } var old = $.fn.affix; $.fn.affix = Plugin; $.fn.affix.Constructor = Affix; // AFFIX NO CONFLICT // ================= $.fn.affix.noConflict = function () { $.fn.affix = old; return this; }; // AFFIX DATA-API // ============== $(window).on('load', function () { $('[data-spy="affix"]').each(function () { var $spy = $(this); var data = $spy.data(); data.offset = data.offset || {}; if (data.offsetBottom !== null) {data.offset.bottom = data.offsetBottom;} if (data.offsetTop !== null) {data.offset.top = data.offsetTop;} Plugin.call($spy, data); }); }); }(jQuery); (function($){ 'use strict'; $.fn.modalSteps = function(options){ var $modal = this; var settings = $.extend({ buttonCancelHtml: 'Annuler', buttonPreviousHtml: 'Précédent', buttonNextHtml: 'Suivant', buttonLastStepHtml: 'Enregistrer', disableNextButton: false, completeCallback: function(){}, callbacks: {} }, options); var validCallbacks = function(){ var everyStepCallback = settings.callbacks['*']; if (everyStepCallback !== undefined && typeof(everyStepCallback) !== 'function'){ throw 'everyStepCallback is not a function! I need a function'; } if (typeof(settings.completeCallback) !== 'function') { throw 'completeCallback is not a function! I need a function'; } for(var step in settings.callbacks){ if (settings.callbacks.hasOwnProperty(step)){ var callback = settings.callbacks[step]; if (step !== '*' && callback !== undefined && typeof(callback) !== 'function'){ throw 'Step ' + step + ' callback must be a function'; } } } }; var executeCallback = function(callback){ if (callback !== undefined && typeof(callback) === 'function'){ callback(); return true; } return false; }; $modal .on('show.bs.modal', function(){ var $modalFooter = $modal.find('.modal-footer'), $buttonCancel = $modalFooter.find('.button-step[data-orientation=cancel]'), $buttonPrevious = $modalFooter.find('.button-step[data-orientation=previous]'), $buttonNext = $modalFooter.find('.button-step[data-orientation=next]'), everyStepCallback = settings.callbacks['*'], stepCallback = settings.callbacks['1'], actualStep, $actualStep, titleStep, $titleStepSpan, nextStep; if (settings.disableNextButton){ $buttonNext.attr('disabled', 'disabled'); } $buttonPrevious.attr('disabled', 'disabled'); validCallbacks(); executeCallback(everyStepCallback); executeCallback(stepCallback); // Setting buttons $buttonCancel.html(settings.buttonCancelHtml); $buttonPrevious.html(settings.buttonPreviousHtml); $buttonNext.html(settings.buttonNextHtml); $actualStep = $('').attr({ 'type': 'hidden', 'id': 'actual-step', 'value': '1', }); $modal.find('#actual-step').remove(); $modal.append($actualStep); actualStep = 1; nextStep = actualStep + 1; $modal.find('[data-step=' + actualStep + ']').removeClass('d-none'); $buttonNext.attr('data-step', nextStep); titleStep = $modal.find('[data-step=' + actualStep + ']').data('title'); $titleStepSpan = $('') .addClass('label label-success') .html(actualStep); $modal .find('.title-step') // .append($titleStepSpan) .append(' ' + titleStep); }) .on('hidden.bs.modal', function(){ var $actualStep = $modal.find('#actual-step'), $buttonNext = $modal.find('.button-step[data-orientation=next]'); $modal .find('[data-step]') .not($modal.find('.button-step')) .addClass('d-none'); $actualStep .not($modal.find('.button-step')) .remove(); $buttonNext .attr('data-step', 1) .html(settings.buttonNextHtml); $modal.find('.title-step').html(''); }); $modal.find('.button-step').on('click', function(){ var $button = $(this), $actualStep = $modal.find('#actual-step'), $buttonPrevious = $modal.find('.button-step[data-orientation=previous]'), $buttonNext = $modal.find('.button-step[data-orientation=next]'), $title = $modal.find('.title-step'), orientation = $button.data('orientation'), actualStep = parseInt($actualStep.val()), everyStepCallback = settings.callbacks['*'], steps, nextStep, $nextStep, newTitle; steps = $modal.find('div[data-step]').length; // Callback on Complete if ($button.attr('data-step') === 'complete'){ settings.completeCallback(); $modal.modal('d-none'); return; } // Check the orientation to make logical operations with actualStep/nextStep if (orientation === 'next'){ nextStep = actualStep + 1; $buttonPrevious.attr('data-step', actualStep); $actualStep.val(nextStep); } else if (orientation === 'previous'){ nextStep = actualStep - 1; $buttonNext.attr('data-step', actualStep); $buttonPrevious.attr('data-step', nextStep - 1); $actualStep.val(actualStep - 1); } else { $modal.modal('d-none'); return; } if (parseInt($actualStep.val()) === steps){ $buttonNext .attr('data-step', 'complete') .html(settings.buttonLastStepHtml); } else { $buttonNext .attr('data-step', nextStep) .html(settings.buttonNextHtml); } if (settings.disableNextButton){ $buttonNext.attr('disabled', 'disabled'); } // d-none and Show steps $modal .find('[data-step=' + actualStep + ']') .not($modal.find('.button-step')) .addClass('d-none'); $modal .find('[data-step=' + nextStep + ']') .not($modal.find('.button-step')) .removeClass('d-none'); // Just a check for the class of previous button if (parseInt($buttonPrevious.attr('data-step')) > 0 ){ $buttonPrevious.removeAttr('disabled'); } else { $buttonPrevious.attr('disabled', 'disabled'); } if (orientation === 'previous'){ $buttonNext.removeAttr('disabled'); } // Get the next step $nextStep = $modal.find('[data-step=' + nextStep + ']'); // Verify if we need to unlock continue button of the next step if ($nextStep.attr('data-unlock-continue')){ $buttonNext.removeAttr('disabled'); } // Set the title of step newTitle = $nextStep.attr('data-title'); var $titleStepSpan = $('') .addClass('label label-success') .html(nextStep); $title .html($title) .append(' ' + newTitle); var stepCallback = settings.callbacks[$actualStep.val()]; executeCallback(everyStepCallback); executeCallback(stepCallback); }); return this; }; }(jQuery)); // @codekit-prepend 'unit/loading.js' // @codekit-prepend 'unit/browser.js' // @codekit-prepend 'unit/navigation.js' // @codekit-prepend 'unit/affix.js' // @codekit-prepend 'unit/steps.js'