bookmarklet.shikiryu.com/js/plugins.js

58 lines
1.0 KiB
JavaScript

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