1$(document).ready(function() { 2 if (!$('#backgroundBox').length) { 3 $(document.body).prepend("<div id='backgroundBox'><div id='loadingBox'></div></div>"); 4 } 5}); 6 7 8/* 9* fonction utilisée pour récupèrer la taille de la fenêtre 10* 11* @return jsonObject contient la largeur et la hauteur de la fenêtre 12*/ 13function getWindowSize() { 14 var w = 0; 15 var h = 0; 16 17 //IE 18 if (!window.innerWidth) { 19 //strict mode 20 if (!(document.documentElement.clientWidth == 0)) { 21 w = document.documentElement.clientWidth; 22 h = document.documentElement.clientHeight; 23 } else { 24 //quirks mode 25 w = document.body.clientWidth; 26 h = document.body.clientHeight; 27 } 28 } else { 29 //w3c 30 w = window.innerWidth; 31 h = window.innerHeight; 32 } 33 34 return {width:w, height:h}; 35} 36 37/* 38* fonction utilisée pour récupèrer les coordonnées pour centrer un élément 39* 40* @param object windowSize, contient la largeur et la hauteur de la fenêtre 41* @param string elementId, l'id de l'élément 42* @return jsonObject contient les valeurs de top et left 43*/ 44function getCenteredCoordinates(windowSize, elementId) { 45 if ($('#' + elementId)) { 46 var t = (windowSize.height - $('#' + elementId).height()) / 2; 47 var l = (windowSize.width - $('#' + elementId).width()) / 2; 48 49 t = Math.round(t); 50 l = Math.round(l); 51 52 return {top:t, left:l}; 53 } 54} 55 56 57/* 58* fonction utilisée pour afficher le div de chargement 59* 60* @param object windowSize, contient la largeur et la hauteur de la fenêtre 61* @param object coordinates, contient les coordonnées du div affichant l'animation 62*/ 63function displayLoadingBox() { 64 var windowSize = getWindowSize(); 65 var coordinates = getCenteredCoordinates(windowSize, 'loadingBox'); 66 67 $('#backgroundBox').css({ 68 'visibility': 'visible', 69 'display': 'block', 70 'width': windowSize.width + 'px', 71 'height': windowSize.height + 'px' 72 }); 73 74 $('#loadingBox').css({ 75 'visibility': 'visible', 76 'display': 'block', 77 'top': coordinates.top + 'px', 78 'left': coordinates.left + 'px' 79 }); 80} 81/* 82* fonction utilisée pour cacher le div de chargement 83* 84*/ 85function hideLoadingBox() { 86 $('#backgroundBox').css({ 87 'visibility': 'hidden', 88 'display': 'none', 89 'width': '0px', 90 'height': '0px' 91 }); 92}
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.