function initCode() { if ( ! /ip(od|hone)/.test(userAgent) ) { if (! /chrome/.test(userAgent) ) { // Disable animation in chrome // It seems they have some progress to do :( $('head').append(''); } } } // --- Google analytics --- function analytics() { var admin = $.cookie('admin'); if (! admin) { // console.log("you're logged by google analytics"); // add an event to all link for google analytics $('a').click(function () { // tell analytics to save event try { var identifier=$(this).attr('id') ; var href=$(this).attr('href') var label=""; if ( typeof( identifier ) != 'undefined' ) { label=label+'[id]:'+identifier category='JSLink' } if ( typeof( href ) != 'undefined' ) { label=label+' [href]:'+href if ( href[0] == '#' ) { category='Anchor'; } else { category='Link'; } } _gaq.push(['_trackEvent', category, 'clicked', label]); // console.log('[tracked]: ' + category + ' ; clicked ; ' + label ); } catch (err) { console.log(err); } // pause to allow google script to run var date = new Date(); var curDate = null; do { curDate = new Date(); } while(curDate-date < 300); }); } else { console.log("[WARNING] you're HIDDEN to analytics"); } } var userAgent; function detectClient() { userAgent = navigator.userAgent.toLowerCase(); if (/msie/.test(userAgent) ) { $('body').prepend('

Avec Firefox , Safari ou Chrome cette page est bien plus jolie !

This page is far nicer when opened with Firefox , Safari or Chrome!

'); } else if (/ip(od|hone)/.test(userAgent)) { $('head').append(''); $('head').append(''); } return userAgent } // Ce que l'on va lancer à l'init. $(document).ready( function() { var client=detectClient(); if ( ! /msie/.test(client) ) { initCode(); } $('#blackpage').fadeOut(); analytics(); }); // --- Google Analytics --- if ( ! $.cookie('admin') ) { var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-10612400-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); } else { console.log("[WARNING] you're HIDDEN to analytics"); }