Difference between revisions of "MediaWiki:Common.js"

From PlayOnLinux
Jump to: navigation, search
Line 2: Line 2:
  
 
$.getScript( "http://www.playonlinux.com/js/highlighter/shCore.js", function( data, textStatus, jqxhr ) {
 
$.getScript( "http://www.playonlinux.com/js/highlighter/shCore.js", function( data, textStatus, jqxhr ) {
alert("test");
+
 
console.log( data ); // Data returned
+
$.getScript( "http://www.playonlinux.com/js/highlighter/shAutoloader.js", function( data, textStatus, jqxhr ) {
console.log( textStatus ); // Success
+
 
console.log( jqxhr.status ); // 200
+
$(".code.playonlinux").each( function( ) {
console.log( "Load was performed." );
+
$(this).attr('class', 'brush: playonlinux;');
 +
});
 +
$(".code.diff").each( function( ) {
 +
$(this).attr('class', 'brush: diff;');
 +
});
 +
SyntaxHighlighter.autoloader(
 +
  ['diff','http://www.playonlinux.com/js/highlighter/diff.js'],
 +
['playonlinux','http://www.playonlinux.com/js/highlighter/playonlinux.js']
 +
 
 +
    );
 +
SyntaxHighlighter.all();
 +
 
 +
});
 +
 
 
});
 
});

Revision as of 22:37, 26 February 2015

/* 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;');
	});
	SyntaxHighlighter.autoloader(
   	 ['diff','http://www.playonlinux.com/js/highlighter/diff.js'],
	 ['playonlinux','http://www.playonlinux.com/js/highlighter/playonlinux.js']

    );
	SyntaxHighlighter.all();

});

});