$(document).ready(function() { /** minimum Menu compatibility for IE 7 - very ugly but IE 7 sucks */ if ($.browser.msie && parseInt($.browser.version, 10) === 7) { $("li.menu").css("margin", "0"); $("li.menu").css("padding", "0"); $("li.sub_menu").css("position", "relative"); } $(".quickbox").hover(function() { $(".quickbox").children("ul").slideDown(); $('#qbbg h1 i').removeClass('icon-angle-down').addClass('icon-angle-up'); }, function() { $(".quickbox").children("ul").slideUp(); $('#qbbg h1 i').removeClass('icon-angle-up').addClass('icon-angle-down'); }); if ($(window).width() < 1200) { $("#l21_logo").hide(); }; $( window ).resize(function() { if ($(window).width() < 1200) { $("#l21_logo").hide(); } else { $("#l21_logo").show(); } }); $("a.out").attr("target", "_blank"); /** $("div#aide").css('display', 'none'); $("a.aide-ancre").click(function() { $("div#aide").slideToggle("slow"); return false; }); */ $(".toggle_title a").click(function() { if($(this).parent().next().css('display')=='none') { $(this).addClass("open"); $(this).parent().next().slideDown(); } else { $(this).removeClass("open"); $(this).parent().next().slideUp(); } return false; }); var cboxOptions = { inline:true, innerWidth: "60%", innerHeight: "80%", maxWidth: "80%", maxHeight: "80%"} jQuery("#menu_help_interface").colorbox(cboxOptions); jQuery(window).resize(function(){ $.colorbox.resize({ width: window.innerWidth > parseInt(cboxOptions.maxWidth) ? cboxOptions.maxWidth : cboxOptions.width, height: window.innerHeight > parseInt(cboxOptions.maxHeight) ? cboxOptions.maxHeight : cboxOptions.height }); }); // $('div.help').attr('id', 'contextual-help'); $('#menu_home').prepend('<\/i>
'); $('#menu_com').prepend('<\/i>
'); $('#menu_gestion').prepend('<\/i>
'); $('#menu_config').prepend('<\/i>
'); // $('#menu_public_interface').prepend('<\/i>
'); $('#menu_help_interface').prepend('<\/i>
'); $('#aide p.info').prepend('<\/i> '); $('#menu_news, #chemin_news').prepend('<\/i>'); $('#menu_publication, #chemin_publication, #menu_contents, #chemin_contents').prepend('<\/i>'); $('#menu_newsletter, #chemin_newsletter').prepend('<\/i>'); $('#menu_comment, #chemin_comment').prepend('<\/i>'); $('#menu_library, #chemin_library').prepend('<\/i>'); $('#menu_page, #chemin_page').prepend('<\/i>'); $('#menu_workshop, #chemin_workshop, #chemin_workshoprep, #workshop-subtitle').prepend('<\/i>'); $('#menu_project, #chemin_project').prepend('<\/i>'); $('#menu_sdi, #chemin_sdi, #indicator-subtitle').prepend('<\/i>'); $('#menu_dashboard, #chemin_dashboard').prepend('<\/i>'); $('#menu_yellowpages, #chemin_yellowpages').prepend('<\/i>'); $('#menu_user, #chemin_user').prepend('<\/i>'); $('#menu_level, #chemin_level').prepend('<\/i>'); $('#menu_scale, #chemin_scale').prepend('<\/i>'); $('#menu_tag, #chemin_tag').prepend('<\/i>'); $('#menu_system, #chemin_system').prepend('<\/i>'); $('#menu_plugins, #chemin_plugins').prepend('<\/i>'); $('#qbbg h1').prepend('<\/i> '); $('#containersearch').hide(); $('#searchDiv').mouseover(function() { if($( "#containersearch" ).is( ":visible" )) { $('#containersearch').fadeOut(); } else { $('#containersearch').fadeIn(); } }); // clone buttons on Validation pages 'dl.summary' if($('dl.summary + form').length) { // if element exists var formId = $('dl.summary + form').attr('id'); $('
').insertBefore( "#content > dl.summary:eq(0)" ); $('dl.summary + form').find('input').each(function() { $el = $(this).clone(false, false).prop({ id: $(this).attr('id') + '-clone'}); $el.appendTo('#' + formId + '-clone'); }); $('#' + formId + '-clone').submit(function(evt) { evt.preventDefault(); // when submit form with jQuery the submit button is not passed // so we recreate it on the fly $('').attr({ type: 'hidden', id: $('#' + formId + ' :submit').attr('id'), name: $('#' + formId + ' :submit').attr('name') }).appendTo('#' + formId); $('#' + formId).submit(); return false; }); } }); function number_f(nb) { nb = nb.toString().replace('.', ','); nb = nb.replace(/\B(?=(\d{3})+(?!\d))/g, " "); return nb; } function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }