🎨 Reformate le code pour lisibilité

This commit is contained in:
Clement Desmidt 2017-01-16 22:57:11 +01:00
parent 55c3db0165
commit 0a2da9f512

View File

@ -1,57 +1,51 @@
// remap jQuery to $ // remap jQuery to $
(function($){ (function ($) {
$('div.french').hide();
$('#main > div > div').hide();
$('#en-lang').click(function(){ $('div.french').hide();
$('.french').hide(); $('#main > div > div').hide();
$('.english').show();
});
$('#fr-lang').click(function(){ $('#en-lang').click(function () {
$('.french').show(); $('.french').hide();
$('.english').hide(); $('.english').show();
}); });
$('h2').click(function(){ $('#fr-lang').click(function () {
$('h2').removeClass('active'); $('.french').show();
$(this).addClass('active'); $('.english').hide();
$('#main > div > div').slideUp(); });
$(this).next('div').slideDown();
});
$('hr').hide(); $('h2').click(function () {
$('h2').removeClass('active');
$(this).addClass('active');
$('#main > div > div').slideUp();
$(this).next('div').slideDown();
});
$('hr').hide();
})(window.jQuery); })(window.jQuery);
// usage: log('inside coolFunc',this,arguments); // usage: log('inside coolFunc',this,arguments);
// paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/ // paulirish.com/2009/log-a-lightweight-wrapper-for-consolelog/
window.log = function(){ window.log = function () {
log.history = log.history || []; // store logs to an array for reference log.history = log.history || []; // store logs to an array for reference
log.history.push(arguments); log.history.push(arguments);
if(this.console){ if (this.console) {
console.log( Array.prototype.slice.call(arguments) ); console.log(Array.prototype.slice.call(arguments));
} }
}; };
// catch all document.write() calls // catch all document.write() calls
(function(doc){ (function (doc) {
var write = doc.write; var write = doc.write;
doc.write = function(q){ doc.write = function (q) {
log('document.write(): ',arguments); log('document.write(): ', arguments);
if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments); if (/docwriteregexwhitelist/.test(q)) write.apply(doc, arguments);
}; };
})(document); })(document);