1(function ($) { 2 3Drupal.behaviors.script = { 4 attach: function (context, settings) { 5 $(function() { 6 7 /* 8 $("a[href*=http]").each(function (index, value){ 9 if ($(this).hasClass('internal') || $(this).attr('target') == '_self') { 10 $(this).attr({ target: "_self" }); 11 } 12 else { 13 $(this).attr({target: "_blank"}); 14 } 15 }); */ 16 17 // NAVS 18 $('.top-nav .last ul.menu').replaceWith($('.top-nav .language-switcher ul')); 19 $('.top-nav .last ul.language-switcher-locale-url').addClass("menu"); 20 $("#nav li, #footer li").each(function(){ 21 if ( $( this ).is(':first-child') && $( this ).is(':last-child') ) { 22 $( this ).addClass('first last'); 23 } else if ( $( this ).is(':first-child') ) { 24 $( this ).addClass('first'); 25 } else if ( $( this ).is(':last-child') ) { 26 $( this ).addClass('last'); 27 } 28 29 if( $( this ).find("ul").length > 0 ){ 30 $( this ).addClass( "submenu" ); 31 } 32 }); 33 34 // BXSLIDER 35 $('.bxslider').each(function(){ 36 if( $(this).find("li").length > 1 ){ 37 var slider = $(this).bxSlider({ 38 captions:true, 39 auto: true, 40 //video:true, 41 onSliderLoad: function(idx) { 42 $(".bxslider iframe").iframeTracker({ 43 blurCallback: function(){ 44 slider.stopAuto(); 45 //alert('test'); 46 } 47 }); 48 } 49 }); 50 } 51 }); 52 $('.fancybox').fancybox({ 53 'transitionIn' : 'elastic', 54 'transitionOut' : 'elastic', 55 'speedIn' : 600, 56 'speedOut' : 200, 57 'overlayShow' : true, 58 'hideOnContentClick': true 59 60 }); 61 62 63 // TIPTIP 64 $(".tiptip").tipTip(); 65 66 if( $(".mini-day-on").length > 0 ){ 67 $(".mini-day-on").each(function(){ 68 69 var content = $(this).find(".calendar_tooltips").html(); 70 $(this).tipTip({maxWidth: "auto", edgeOffset: 5, content: content, keepAlive: true}); 71 $(this).find("a").click(function(e){ 72 e.preventDefault; 73 return false; 74 }); 75 76 }); 77 } 78 79 // MOSAIC 80 $('.mosaic-zone').mosaic({ 81 animation : 'slide' 82 }); 83 84 $('.mosaic-zone').css('cursor','pointer'); 85 $('.mosaic-zone').click(function() { 86 87 var a_href = $(this).find("a").attr('href'); 88 if( a_href != null && a_href != '' && a_href != 'undefined' ) { 89 window.location = a_href; 90 } 91 }); 92 93 // IE9- 94 $('input').placeholder(); 95 96 // MOBILE VERSION 97 $("#mobile-nav .btn-nav").click(function(){ 98 $("#nav").slideToggle(); 99 }); 100 $("#mobile-nav .btn-search").click(function(){ 101 $("#search-block-form").slideToggle(); 102 }); 103 104 // CHANGE FIRST TOP MENU LINK 105 /*var attr_sav_first = $(".top-nav ul ul li.first a").attr("href"); 106 var attr_sav_last = $(".top-nav ul ul li.last a").attr("href"); 107 108 $(".top-nav .submenu a").removeAttr("href"); 109 $(".top-nav ul li.first a").removeAttr("href"); 110 111 $(".top-nav ul ul li.first a").attr("href",attr_sav_first); 112 $(".top-nav ul ul li.last a").attr("href",attr_sav_last); 113 114 $(".top-nav ul ul li.first").removeClass( "first" );*/ 115 116 $("#search-block-form").addClass( "clearfix" ); 117 118 119 120 var res; // mobile > 320, phablet > 600, tablette > 800, desktop > 960, screen > 1140 121 function resizeWin(){ 122 var t = $(window).width(); 123 if(t <= 600){ 124 res = "mobile"; 125 }else if(t <= 800){ 126 res = "phablet"; 127 }else if(t <= 960){ 128 res = "tablette"; 129 }else if(t <= 1140){ 130 res = "desktop"; 131 }else if(t <= 3000){ 132 res = "screen"; 133 } 134 135 // ajout sidr si res == desktop 136 if(res == "desktop" || res == "tablette" || res == "phablet"){ 137 /*$('#top-nav .btn-nav, #left-nav').sidr({ 138 name: 'main-nav', 139 side: 'left' // By default 140 });*/ 141 142 /*$( document.body ).on("mouseover", "#top-nav .btn-nav", function(){ 143 $("#main-nav").css({ 144 'display':'block', 145 'opacity':0 146 }).animate({ 147 opacity: 1, 148 left: 0 149 }, 1000); 150 }).on("mouseleave", "#top-nav .btn-nav", function(){ 151 $("#main-nav").animate({ 152 opacity: 0, 153 left: -220 154 }, 1000, function(){ 155 $("#main-nav").hide(); 156 }); 157 });*/ 158 159 $( document.body ).off("click", ".top-nav .btn-nav, .top-nav li.first, #left-nav, #left-close-nav"); 160 $( document.body ).on("click", ".top-nav .btn-nav, .top-nav li.first, #left-nav, #left-close-nav", function(){ 161 162 if( $("#block-system-main-menu").hasClass( "active-nav" ) ){ 163 164 $("#block-system-main-menu").animate({ 165 left: -220 166 }, 200, function(){ 167 $("#block-system-main-menu").hide().removeClass( "active-nav" ); 168 }); 169 170 }else{ 171
172 $("#block-system-main-menu").css({ "left":-220 }).show().animate({ 173 opacity: 1, 174 left: 0 175 }, 400).addClass( "active-nav" ); 176 177 } 178 }); 179 180 181 }else{ 182 183 $("#block-system-main-menu").show().css({ "left":0 }); 184 185 } 186 187 createSubmenu(); 188 189 } 190 191 $(window).resize(function() { 192 resizeWin(); 193 }); 194 resizeWin(); 195 196 function createSubmenu(){ 197 198 /*$( document.body ).on("click", ".submenu", function(){ 199 $( this ).toggleClass( "active" ).find( "ul" ).slideToggle(); 200 });*/ 201 202 /*$( document.body ).on("mouseover", ".submenu", function(){ 203 $( this ).dequeue().addClass( "active" ).find( "ul" ).slideDown(); 204 }).on("mouseleave", ".submenu", function(){ 205 $( this ).dequeue().removeClass( "active" ).find( "ul" ).slideUp(); 206 });*/ 207 208 if( res == "screen" || res == "mobile" ){ 209 210 $( "#block-system-main-menu .submenu" ).each(function(){ 211 //showNav( $(this), 0 ); 212 }); 213 214 $( document.body ).on("mouseover", ".submenu", function(){ 215 $(this).addClass('open'); 216 }).on("mouseleave", ".submenu", function(){ 217 $(this).removeClass('open'); 218 }); 219 220 }else{ 221 222 $( "#block-system-main-menu .submenu" ).each(function(){ 223 //showNav( $(this), 99 ); 224 }); 225 226 $( document.body ).on("mouseover", "#block-menu-menu-menu-sommital .submenu", function(){ 227 //showNav( $(this), 1 ); 228 }).on("mouseleave", "#block-menu-menu-menu-sommital .submenu", function(){ 229 //showNav( $(this), 0 ); 230 }); 231 232 } 233 234 if( res == "phablet" || res == "tablette" || res == "desktop" ){ 235 236 // add btn 237 if( $("#left-nav").length == 0 ){ 238 var b = $('<a>', { 239 id: 'left-nav' 240 }); 241 $( document.body ).append( b ); 242 } 243 244 // add close btn 245 if( $("#left-close-nav").length == 0 ){ 246 var b = $('<a>', { 247 id: 'left-close-nav' 248 }); 249 $( "#block-system-main-menu" ).prepend( b ); 250 } 251 252 // adapte line-height 253 var lh = (($( window ).height() - 30) / 15); 254 $("#block-system-main-menu a").css({ 'line-height':lh+'px' }); 255 256 }else{ 257 258 // remove btn 259 if( $("#left-nav").length != 0 ){ 260 $("#left-nav").remove(); 261 } 262 263 if( $("#left-close-nav").length != 0 ){ 264 $( "left-close-nav" ).remove(); 265 } 266 267 // adapte line-height 268 $("#block-system-main-menu a").css({ 'line-height':'' }); 269 270 } 271 272 } 273 // CREATEMENU 274 function showNav( oEl, c ){ 275 276 /*if( c == 1 && res == "screen" ){ 277 $( oEl ).find( "ul" ).clearQueue().slideDown(function(){ $( oEl ).addClass( "active" ); }); 278 }else if( c == 0 && res == "screen" ){ 279 $( oEl ).removeClass( "active" ).find( "ul" ).clearQueue().stop().slideUp(); 280 }else{ 281 $( oEl ).addClass( "active" ).find( "ul" ).show().css( { 'height':'auto' }); 282 }*/ 283 284 if( $( oEl ).hasClass( "expanded" ) && $( oEl ).find( "ul").find("li.active-trail" ).length > 0 ){ 285 $( oEl ).find( "ul" ).show(); 286 }else{ 287 288 if( c == 1 && (res == "screen" || res == "mobile") ){ 289 $( oEl ).find( "ul" ).clearQueue().slideDown(function(){ $( oEl ).addClass( "active" ); }); 290 }else if( c == 0 && (res == "screen" || res == "mobile" || $( oEl ).parent().parent().parent(".top-nav")) ){ 291 $( oEl ).removeClass( "active" ).find( "ul" ).clearQueue().stop().slideUp(); 292 }else{ 293 $( oEl ).addClass( "active" ).find( "ul" ).show().css( { 'height':'auto' }); 294 } 295 296 } 297 298 } 299 300 }); 301 302} 303} 304 305})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.