Created
March 5, 2011 15:54
-
-
Save michaelfox/856461 to your computer and use it in GitHub Desktop.
A largely un-curated "dump" of JavaScript Bookmarklets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var%20script=document.createElement('script');script.src='http://mir.aculo.us/dom-monster/dommonster.js?'+Math.floor((+new Date)/(864e5));document.body.appendChild(script);})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var%20auto%20={names:%20'Steve%20Buscemi%20Catherine%20Keener%20Dermot%20Mulroney%20Danielle%20Zerneck%20James%20LeGros%20Rica%20Martens%20Peter%20Dinklage%20Kevin%20Corrigan%20Hilary%20Gilford%20Robert%20Wightman%20Tom%20Jarmusch%20Michael%20Griffiths%20Matthew%20Grace%20Ryan%20Bowker%20Francesca%20DiMauro',blurb:%20'phpBB%20is%20a%20free,%20open%20source%20Internet%20community%20application,%20with%20outstanding%20discussion%20forums%20and%20membership%20management.%20Written%20in%20the%20PHP%20scripting%20language,%20and%20making%20use%20of%20the%20popular%20MySQL%20database,%20phpBB%20is%20a%20standard%20among%20web%20hosting%20companies%20throughout%20the%20world,%20and%20is%20one%20of%20the%20most%20widely-used%20bulletin%20board%20packages%20in%20the%20world.%20phpBB%20short-circuits%20the%20need%20for%20you%20to%20be%20a%20web%20development%20master%20in%20order%20to%20create%20and%20manage%20massive%20online%20communities',password:%20'secret',fillerup:%20function()%20{var%20all_inputs%20=%20document.getElementsByTagName('input');var%20all_selects%20=%20document.getElementsByTagName('select');var%20all_textareas%20=%20document.getElementsByTagName('textarea');for%20(var%20i%20=%200,%20max%20=%20all_selects.length;%20i%20<%20max;%20i++)%20{var%20sel%20=%20all_selects[i];%20if%20(sel.selectedIndex%20!=%20-1&&%20sel.options[sel.selectedIndex].value)%20{continue;%20}var%20howmany%20=%201;%20if%20(sel.type%20==%20'select-multiple')%20{%20var%20howmany%20=%201%20+%20this.getRand(sel.options.length%20-%201);}for%20(var%20j%20=%200;%20j%20<%20howmany;%20j++)%20{var%20index%20=%20this.getRand(sel.options.length%20-%201);sel.options[index].selected%20=%20'selected';}}for%20(var%20i%20=%200,%20max%20=%20all_textareas.length;%20i%20<%20max;%20i++)%20{var%20ta%20=%20all_textareas[i];if%20(!ta.value)%20{ta.value%20=%20this.getRandomString(10)+%20'\n\n'+%20this.getRandomString(10);}}for%20(var%20i%20=%200,%20max%20=%20all_inputs.length;%20i%20<%20max;%20i++)%20{var%20inp%20=%20all_inputs[i];var%20type%20=%20inp.getAttribute('type');if%20(!type)%20{type%20=%20'text';%20}if%20(type%20==%20'checkbox')%20{inp.setAttribute('checked',%20'checked');}if%20(type%20==%20'radio')%20{var%20to_update%20=%20true;var%20name%20=%20inp.name;var%20input_array%20=%20inp.form.elements[inp.name];for%20(var%20j%20=%200;%20j%20<%20input_array.length;%20j++)%20{if%20(input_array[j].checked)%20{to_update%20=%20false;continue;}}if%20(to_update)%20{var%20index%20=%20this.getRand(input_array.length%20-%201);input_array[index].setAttribute('checked',%20'checked');}}if%20(type%20==%20'password')%20{if%20(!inp.value)%20{inp.value%20=%20this.getPassword();}}if%20(type%20==%20'text')%20{if%20(!inp.value)%20{if%20(inp.name.indexOf('name')%20!=%20-1)%20{inp.value%20=%20this.getRandomName()%20+%20'%20'%20+%20this.getRandomName();}%20else%20if%20(inp.name.indexOf('email')%20!=%20-1)%20{inp.value%20=%20this.getRandomString(1)%20+%20'@example.org';}%20else%20{inp.value%20=%20this.getRandomString(1);}}}}},getRandomString:%20function%20(how_many_words)%20{if%20(!how_many_words)%20{how_many_words%20=%205;}if%20(!this.words)%20{this.words%20=%20this.blurb.split('%20');}var%20retval%20=%20'';for%20(var%20i%20=%200;%20i%20<%20how_many_words;%20i++)%20{retval%20+=%20this.words[this.getRand(this.words.length)%20-%201];retval%20+=%20(i%20<%20how_many_words%20-%201)%20?%20'%20'%20:%20'';}return%20retval;},getRandomName:%20function%20()%20{if%20(!this.split_names)%20{this.split_names%20=%20this.names.split('%20');}return%20this.split_names[this.getRand(this.split_names.length)%20-%201];},getPassword:%20function%20()%20{if%20(!this.password)%20{this.password%20=%20'secret';}return%20this.password;},getRand:%20function%20(count)%20{return%20Math.round(count%20*%20Math.random());}};%20auto.fillerup() | |
/* Uncompressed */ | |
var auto = { | |
names: 'Steve Buscemi Catherine Keener Dermot Mulroney Danielle Zerneck James LeGros Rica Martens Peter Dinklage Kevin Corrigan Hilary Gilford Robert Wightman Tom Jarmusch Michael Griffiths Matthew Grace Ryan Bowker Francesca DiMauro', | |
blurb: 'phpBB is a free, open source Internet community application, with outstanding discussion forums and membership management. Written in the PHP scripting language, and making use of the popular MySQL database, phpBB is a standard among web hosting companies throughout the world, and is one of the most widely-used bulletin board packages in the world. phpBB short-circuits the need for you to be a web development master in order to create and manage massive online communities', | |
password: 'secret', | |
fillerup: function() { | |
var all_inputs = document.getElementsByTagName('input'); | |
var all_selects = document.getElementsByTagName('select'); | |
var all_textareas = document.getElementsByTagName('textarea'); | |
for (var i = 0, max = all_selects.length; i < max; i++) { | |
var sel = all_selects[i]; | |
if (sel.selectedIndex != -1 && sel.options[sel.selectedIndex].value) { | |
continue; | |
} | |
var howmany = 1; | |
if (sel.type == 'select-multiple') { | |
var howmany = 1 + this.getRand(sel.options.length - 1); | |
} | |
for (var j = 0; j < howmany; j++) { | |
var index = this.getRand(sel.options.length - 1); | |
sel.options[index].selected = 'selected'; | |
} | |
} | |
for (var i = 0, max = all_textareas.length; i < max; i++) { | |
var ta = all_textareas[i]; | |
if (!ta.value) { | |
ta.value = this.getRandomString(10) + '\n\n' + this.getRandomString(10); | |
} | |
} | |
for (var i = 0, max = all_inputs.length; i < max; i++) { | |
var inp = all_inputs[i]; | |
var type = inp.getAttribute('type'); | |
if (!type) { | |
type = 'text'; | |
} | |
if (type == 'checkbox') { | |
inp.setAttribute('checked', 'checked'); | |
} | |
if (type == 'radio') { | |
var to_update = true; | |
var name = inp.name; | |
var input_array = inp.form.elements[inp.name]; | |
for (var j = 0; j < input_array.length; j++) { | |
if (input_array[j].checked) { | |
to_update = false; | |
continue; | |
} | |
} | |
if (to_update) { | |
var index = this.getRand(input_array.length - 1); | |
input_array[index].setAttribute('checked', 'checked'); | |
} | |
} | |
if (type == 'password') { | |
if (!inp.value) { | |
inp.value = this.getPassword(); | |
} | |
} | |
if (type == 'text') { | |
if (!inp.value) { | |
if (inp.name.indexOf('name') != -1) { | |
inp.value = this.getRandomName() + ' ' + this.getRandomName(); | |
} | |
else if (inp.name.indexOf('email') != -1) { | |
inp.value = this.getRandomString(1) + '@example.org'; | |
} | |
else { | |
inp.value = this.getRandomString(1); | |
} | |
} | |
} | |
} | |
}, | |
getRandomString: function(how_many_words) { | |
if (!how_many_words) { | |
how_many_words = 5; | |
} | |
if (!this.words) { | |
this.words = this.blurb.split(' '); | |
} | |
var retval = ''; | |
for (var i = 0; i < how_many_words; i++) { | |
retval += this.words[this.getRand(this.words.length) - 1]; | |
retval += (i < how_many_words - 1) ? ' ' : ''; | |
} | |
return retval; | |
}, | |
getRandomName: function() { | |
if (!this.split_names) { | |
this.split_names = this.names.split(' '); | |
} | |
return this.split_names[this.getRand(this.split_names.length) - 1]; | |
}, | |
getPassword: function() { | |
if (!this.password) { | |
this.password = 'secret'; | |
} | |
return this.password; | |
}, | |
getRand: function(count) { | |
return Math.round(count * Math.random()); | |
} | |
};auto.fillerup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet */ | |
javascript:%20(function(){var%20el=document.createElement('div'),b=document.getElementsByTagName('body')[0];otherlib=false,msg='';el.style.position='fixed';el.style.height='32px';el.style.width='220px';el.style.marginLeft='-110px';el.style.top='0';el.style.left='50%';el.style.padding='5px%2010px';el.style.zIndex=1001;el.style.fontSize='12px';el.style.color='#222';el.style.backgroundColor='#f99';if(typeof%20jQuery!='undefined'){msg='This%20page%20already%20using%20jQuery%20v'+jQuery.fn.jquery;return%20showMsg();}else%20if(typeof%20$=='function'){otherlib=true;}%20function%20getScript(url,success){var%20script=document.createElement('script');script.src=url;var%20head=document.getElementsByTagName('head')[0],done=false;script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;success();script.onload=script.onreadystatechange=null;head.removeChild(script);}};head.appendChild(script);}%20getScript('http://code.jquery.com/jquery-latest.min.js',function(){if(typeof%20jQuery=='undefined'){msg='Sorry,%20but%20jQuery%20wasn\'t%20able%20to%20load';}else{msg='This%20page%20is%20now%20jQuerified%20with%20v'+jQuery.fn.jquery;if(otherlib){msg+='%20and%20noConflict().%20Use%20$jq(),%20not%20$().';}}%20return%20showMsg();});function%20showMsg(){el.innerHTML=msg;b.appendChild(el);window.setTimeout(function(){if(typeof%20jQuery=='undefined'){b.removeChild(el);}else{jQuery(el).fadeOut('slow',function(){jQuery(this).remove();});if(otherlib){$jq=jQuery.noConflict();}}},2500);}})(); | |
/* Uncompressed */ | |
(function() { | |
var el=document.createElement('div'), | |
b=document.getElementsByTagName('body')[0], | |
otherlib=false, | |
msg=''; | |
el.style.position='fixed'; | |
el.style.height='32px'; | |
el.style.width='220px'; | |
el.style.marginLeft='-110px'; | |
el.style.top='0'; | |
el.style.left='50%'; | |
el.style.padding='5px 10px'; | |
el.style.zIndex = 1001; | |
el.style.fontSize='12px'; | |
el.style.color='#222'; | |
el.style.backgroundColor='#f99'; | |
if(typeof jQuery!='undefined') { | |
msg='This page already using jQuery v'+jQuery.fn.jquery; | |
return showMsg(); | |
} else if (typeof $=='function') { | |
otherlib=true; | |
} | |
// more or less stolen form jquery core and adapted by paul irish | |
function getScript(url,success){ | |
var script=document.createElement('script'); | |
script.src=url; | |
var head=document.getElementsByTagName('head')[0], | |
done=false; | |
// Attach handlers for all browsers | |
script.onload=script.onreadystatechange = function(){ | |
if ( !done && (!this.readyState | |
|| this.readyState == 'loaded' | |
|| this.readyState == 'complete') ) { | |
done=true; | |
success(); | |
script.onload = script.onreadystatechange = null; | |
head.removeChild(script); | |
} | |
}; | |
head.appendChild(script); | |
} | |
getScript('http://code.jquery.com/jquery-latest.min.js',function() { | |
if (typeof jQuery=='undefined') { | |
msg='Sorry, but jQuery wasn\'t able to load'; | |
} else { | |
msg='This page is now jQuerified with v' + jQuery.fn.jquery; | |
if (otherlib) {msg+=' and noConflict(). Use $jq(), not $().';} | |
} | |
return showMsg(); | |
}); | |
function showMsg() { | |
el.innerHTML=msg; | |
b.appendChild(el); | |
window.setTimeout(function() { | |
if (typeof jQuery=='undefined') { | |
b.removeChild(el); | |
} else { | |
jQuery(el).fadeOut('slow',function() { | |
jQuery(this).remove(); | |
}); | |
if (otherlib) { | |
$jq=jQuery.noConflict(); | |
} | |
} | |
} ,2500); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**! | |
* Open the current github repository in GithubFinder App | |
* Date: 2011-03-05 | |
* Source: http://sr3d.github.com/GithubFinder/ | |
* Links: | |
* - https://github.com/sr3d/GithubFinder | |
* - http://sr3d.github.com/GithubFinder/userscript.user.js | |
*/ | |
javascript:(function(){var a=(new RegExp("github.com/(.+)","i")).exec(window.location.href);var f=a?a[1].split("/"):[];var b=f[0];var d=f[1];var e=f[3];var c="http://sr3d.github.com/GithubFinder/?utm_source=bml"+(a?"&user_id="+b+"&repo="+d+(e?"&branch="+e:""):"");if(!c){alert("Invalid Github URL");return}window.open(c)})() | |
/* Uncompressed */ | |
(function() { | |
var a = (new RegExp("github.com/(.+)", "i")).exec(window.location.href); | |
var f = a ? a[1].split("/") : []; | |
var b = f[0]; | |
var d = f[1]; | |
var e = f[3]; | |
var c = "http://sr3d.github.com/GithubFinder/?utm_source=bml" + (a ? "&user_id=" + b + "&repo=" + d + (e ? "&branch=" + e : "") : ""); | |
if (!c) { | |
alert("Invalid Github URL"); | |
return | |
} | |
window.open(c) | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment