-
Notifications
You must be signed in to change notification settings - Fork 0
Bookmarklets
mitochondrion edited this page Oct 1, 2017
·
7 revisions
Generate bookmarklets from javascript using http://mrcoles.com/bookmarklet/.
Increase content width on sites that often display code that is longer than the content width.
(function()%7Bvar%20host%20%3D%20location.hostname%3Bif%20(host.includes('github.com'))%20%7Bdocument.querySelectorAll('.repository-content')%5B0%5D.style.width%20%3D%20%221375px%22%3Bdocument.querySelectorAll('.discussion-timeline')%5B0%5D.style.width%20%3D%20%221150px%22%3Bvar%20containers%20%3D%20document.querySelectorAll('.container')%3Bcontainers.forEach(function(e)%20%7Be.style.marginLeft%20%3D%20%2220px%22%3B%7D)%3B%7Dif%20(host.includes('stackoverflow.com')%20%7C%7C%20host.includes('stackexchange.com'))%20%7Bdocument.querySelectorAll('%23content')%5B0%5D.style.width%20%3D%20%221450px%22%3Bvar%20posts%20%3D%20document.querySelectorAll('.post-text')%3Bposts.forEach(function(e)%20%7Be.style.width%20%3D%20%221150px%22%3B%7D)%3B%7D%7D)()
// javascript:(function()%7Bvar host %3D location.hostname%3Bif (host.includes('github.com')) %7Bdocument.querySelectorAll('.repository-content')%5B0%5D.style.width %3D "1375px"%3Bdocument.querySelectorAll('.discussion-timeline')%5B0%5D.style.width %3D "1150px"%3Bvar containers %3D document.querySelectorAll('.container')%3Bcontainers.forEach(function(e) %7Be.style.marginLeft %3D "20px"%3B%7D)%3B%7Dif (host.includes('stackoverflow.com') %7C%7C host.includes('stackexchange.com')) %7Bdocument.querySelectorAll('%23content')%5B0%5D.style.width %3D "1450px"%3Bvar posts %3D document.querySelectorAll('.post-text')%3Bposts.forEach(function(e) %7Be.style.width %3D "1150px"%3B%7D)%3B%7D%7D)()var host = location.hostname;
if (host.includes('github.com')) {
document.querySelectorAll('.repository-content')[0].style.width = "1375px";
document.querySelectorAll('.discussion-timeline')[0].style.width = "1150px";
var containers = document.querySelectorAll('.container');
containers.forEach(function(e) {e.style.marginLeft = "20px";});
}
if (host.includes('stackoverflow.com') || host.includes('stackexchange.com')) {
document.querySelectorAll('#content')[0].style.width = "1450px";
var posts = document.querySelectorAll('.post-text');
posts.forEach(function(e) {e.style.width = "1150px";});
}
/* JQuery no longer loads on github
var host = location.hostname;
if (host.includes('github.com')) {
$('.repository-content').width(1100);
}
if (host.includes('stackoverflow.com') || host.includes('stackexchange.com')) {
$('#content').width(1450);
$('.post-text').each(function(e) {$(this).width(1150)});
}
*/