Difference between revisions of "MediaWiki:Common.js"

From PlayOnLinux
Jump to: navigation, search
Line 29: Line 29:
  
 
     var ga;
 
     var ga;
     if ($.cookie("cookieconsent_status") !== "deny") {
+
     //if ($.cookie("cookieconsent_status") !== "deny") {
 
         (function (i, s, o, g, r, a, m) {
 
         (function (i, s, o, g, r, a, m) {
 
             i['GoogleAnalyticsObject'] = r;
 
             i['GoogleAnalyticsObject'] = r;
Line 44: Line 44:
 
         ga('require', 'displayfeatures');
 
         ga('require', 'displayfeatures');
 
         ga('send', 'pageview');
 
         ga('send', 'pageview');
     } else {
+
     //} else {
        ga = [0];
+
    //    ga = [0];
     }
+
     //}
  
  
 
document.body.innerHTML = ('<div class="mainheader"><div class="reducer"><a href="https://www.playonlinux.com"><img src="https://www.playonlinux.com/images/logos/logo96.png" alt="playonlinux" /> playonlinux</a><ul id="menuul"><li><a href="https://www.playonlinux.com/en">Home</a></li><li><a href="https://www.playonlinux.com/en/supported_apps.html">Supported software</a></li><li><a href="https://www.playonlinux.com/en/news.html">News</a></li><li><a href="https://www.playonlinux.com/en/download.html">Download</a></li><li class="selected"><a href="http://wiki.playonlinux.com/">Wiki</a></li><li><a href="https://www.playonlinux.com/en/forums.html">Forums</a></li><li><a href="https://www.playonlinux.com/en/bugs.html">Bugs</a></li></ul></div></div>') + document.body.innerHTML;
 
document.body.innerHTML = ('<div class="mainheader"><div class="reducer"><a href="https://www.playonlinux.com"><img src="https://www.playonlinux.com/images/logos/logo96.png" alt="playonlinux" /> playonlinux</a><ul id="menuul"><li><a href="https://www.playonlinux.com/en">Home</a></li><li><a href="https://www.playonlinux.com/en/supported_apps.html">Supported software</a></li><li><a href="https://www.playonlinux.com/en/news.html">News</a></li><li><a href="https://www.playonlinux.com/en/download.html">Download</a></li><li class="selected"><a href="http://wiki.playonlinux.com/">Wiki</a></li><li><a href="https://www.playonlinux.com/en/forums.html">Forums</a></li><li><a href="https://www.playonlinux.com/en/bugs.html">Bugs</a></li></ul></div></div>') + document.body.innerHTML;

Revision as of 21:06, 26 January 2021

/* Tout JavaScript ici sera chargé avec chaque page accédée par n’importe quel utilisateur. */
$.getScript( "http://www.playonlinux.com/js/highlighter/shCore.js", function( data, textStatus, jqxhr ) {
	$.getScript( "http://www.playonlinux.com/js/highlighter/shAutoloader.js", function( data, textStatus, jqxhr ) {
		$(".code.playonlinux").each( function( ) {
			$(this).attr('class', 'brush: playonlinux;');
		});
		$(".code.diff").each( function( ) {
			$(this).attr('class', 'brush: diff;');
		});
		$(".code.bash").each( function( ) {
			$(this).attr('class', 'brush: bash;');
		});
		$(".code.python").each( function( ) {
			$(this).attr('class', 'brush: python;');
		});
		$(".code.java").each( function( ) {
			$(this).attr('class', 'brush: java;');
		});
		SyntaxHighlighter.autoloader(
		['diff','http://www.playonlinux.com/js/highlighter/diff.js'],
		['playonlinux','http://www.playonlinux.com/js/highlighter/playonlinux.js'],
		['bash','http://www.playonlinux.com/js/highlighter/bash.js'],
		['python','http://www.playonlinux.com/js/highlighter/python.js'],
                ['java','http://www.playonlinux.com/js/highlighter/java.js']
		);
		SyntaxHighlighter.all();
	});
});

    var ga;
    //if ($.cookie("cookieconsent_status") !== "deny") {
        (function (i, s, o, g, r, a, m) {
            i['GoogleAnalyticsObject'] = r;
            i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
            a = s.createElement(o),
                m = s.getElementsByTagName(o)[0];
            a.async = 0;
            a.src = g;
            m.parentNode.insertBefore(a, m)
        })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
        ga('create', 'UA-7841956-1', 'auto');
        ga('require', 'displayfeatures');
        ga('send', 'pageview');
    //} else {
    //    ga = [0];
    //}


document.body.innerHTML = ('<div class="mainheader"><div class="reducer"><a href="https://www.playonlinux.com"><img src="https://www.playonlinux.com/images/logos/logo96.png" alt="playonlinux" /> playonlinux</a><ul id="menuul"><li><a href="https://www.playonlinux.com/en">Home</a></li><li><a href="https://www.playonlinux.com/en/supported_apps.html">Supported software</a></li><li><a href="https://www.playonlinux.com/en/news.html">News</a></li><li><a href="https://www.playonlinux.com/en/download.html">Download</a></li><li class="selected"><a href="http://wiki.playonlinux.com/">Wiki</a></li><li><a href="https://www.playonlinux.com/en/forums.html">Forums</a></li><li><a href="https://www.playonlinux.com/en/bugs.html">Bugs</a></li></ul></div></div>') + document.body.innerHTML;