/**
* @author https://codepen.io/bookmarklets
* @file Dropdown menu for Reddit with cool tools!
Bulk UpVote/Downvote, switch from old to new Reddit, Stealth mode, etc.
* Original Source {@link https://cdpn.io/bookmarklets/fullpage/NobJbq#}
*/
javascript: if(window.location.hostname.includes('reddit')) {
if(document.getElementById('mymenu')) {
document.getElementById('mymenu').remove();
}else{
function switcher(){
var url = location.href;
if (url.includes('www')) {
var url = url.replace('www', 'old');
window.open(url,'_self');
} else if (url.includes('new')) {
var url = url.replace('new', 'old');
window.open(url,'_self');
} else {
var url = url.replace('old', 'www');
window.open(url,'_self');}
}
var switchIt= 'Old/New Reddit';
function upVote(){if(window.location.href.indexOf('old.reddit.com/r/') > -1 || window.location.href.indexOf('old.reddit.com/u/') > -1) {
(function(){var q=[];$('.up').each(function(){var that=this;var f=function(index){$(that).trigger('click');$(that).trigger('mousedown');setTimeout(function(){if(q[index]){q[index](index+1);}else{if(upVoteTimer){window.clearTimeout(upVoteTimer);}}},500);};q.push(f);});var upVoteTimer=window.setTimeout(function(){q[0](1);},50);}());
} else if (window.location.href.indexOf('old.reddit.com/user/') > -1){
void!function(){document.querySelectorAll('[data-event-action="upvote"]').forEach(function(o){"upvote"===o.dataset.eventAction&&o.click()}),document.querySelectorAll(".icon-upvote").forEach(function(o){o.click()})}();
} else {
alert('You need to be voting in a single sub or user page in OLD reddit for this to work!\nSWITCH TO OLD REDDIT!\n
Go to: http://old.reddit.com/r/ and choose a subreddit or user to vote on!')
};}
var upVoteIt= '↑ UpVote All';
function downVote(){if(window.location.href.indexOf('old.reddit.com/r/') > -1 || window.location.href.indexOf('old.reddit.com/u/') > -1) {
(function(){var q=[];$('.down').each(function(){var that=this;var f=function(index){$(that).trigger('click');$(that).trigger('mousedown');setTimeout(function(){if(q[index]){q[index](index+1);}else{if(downVoteTimer){window.clearTimeout(downVoteTimer);}}},500);};q.push(f);});var downVoteTimer=window.setTimeout(function(){q[0](1);},50);}());
} else if (window.location.href.indexOf('old.reddit.com/user/') > -1){
void!function(){document.querySelectorAll('[data-event-action="downvote"]').forEach(function(o){"downvote"===o.dataset.eventAction&&o.click()}),document.querySelectorAll(".icon-downvote").forEach(function(o){o.click()})}();
} else {
alert('You need to be voting in a single sub in OLD reddit for this to work!\nSWITCH TO OLD REDDIT!\n
Go to: http://old.reddit.com/r/ and choose a subreddit')
};}
var downVoteIt= '↓ DownVote All';
function stealth(){if(window.location.href.indexOf('old.reddit.com') > -1) {
(function(){var newcss='.midcol, .thumbnail, .rank, .flairichtext, .flaircolordark, .linkflairlabel, .flaircolorlight, .res-flairSearch {display:none} .title {color:black !important} .title{font-size:120% !important} body {background-color:white}';
if('\v'=='v'){document.createStyleSheet().cssText=newcss}else{var tag=document.createElement('style');
tag.type='text/css';document.getElementsByTagName('head')[0].appendChild(tag);
tag[(typeof document.body.style.WebkitAppearance=='string')?'innerText':'innerHTML']=newcss}})();document.getElementsByClassName('side')[0].remove();document.getElementById('header').remove();
document.getElementsByClassName('panestack-title')[0].remove();document.getElementsByClassName('menuarea')[0].remove();
document.getElementsByClassName('usertext cloneable')[0].remove();document.getElementsByName('content')[0].remove();
document.getElementsByClassName('footer-parent')[0].remove();
} else if (window.location.href.indexOf('reddit.com') > -1) {
(function(){(function () {var i, elements = document.querySelectorAll('body *');for (i = 0; i < elements.length; i++) {if (getComputedStyle(elements[i]).position === 'fixed') {elements[i].parentNode.removeChild(elements[i]);}}})()})();
(function(){var e=document.getElementsByClassName('s7pq5uy-6')||('jspfgX');
if(e[0].style.display=='none') {e[0].style.display='block'}else{e[0].style.display='none'}})();
} else {
alert('You need to be on Reddit.com for this bookmarklet to work!\nStealth mode looks best on old.reddit.com!');
};
}
var stealthIt= 'Stealth Mode';
function coder(){(function(){var newcss='.midcol, .thumbnail, .rank, .flairichtext, .flaircolordark, .linkflairlabel, .flaircolorlight, .res-flairSearch {display:none} .title {color:green !important} .title{font-size:120% !important} body {background-color:black}';if('\v'=='v'){document.createStyleSheet().cssText=newcss}else{var tag=document.createElement('style');tag.type='text/css';document.getElementsByTagName('head')[0].appendChild(tag);tag[(typeof document.body.style.WebkitAppearance=='string')?'innerText':'innerHTML']=newcss}})();document.getElementsByClassName('side')[0].remove();document.getElementById('header').remove();document.getElementsByClassName('panestack-title')[0].remove();document.getElementsByClassName('menuarea')[0].remove();document.getElementsByClassName('usertext cloneable')[0].remove();document.getElementsByName('content')[0].remove();document.getElementsByClassName('footer-parent')[0].remove();}
var coderIt= 'Coder Mode';
function baseTag(){var insertBase;
var baseTag;
insertBase = document.createElement('base');
insertBase.id = 'myBase';
insertBase.innerHTML ='
This works best
in OLD REDDIT';
var spacer='..........';
}
function hideMenu() { document.getElementById('mymenu').remove(); };
function replaceText() {
document.getElementById('demo').innerHTML = ' Click to switch
to OLD REDDIT';
}
function original() {
document.getElementById('demo').innerHTML = 'This works best
in OLD REDDIT';
}
function makeOld(){
var url=document.location.href;
var url = url.replace('www', 'old');
var url = url.replace('new', 'old');
window.open(url,'_self');
}
function infoPop(){var a='