Last active
June 23, 2016 02:41
-
-
Save unt0uchable/46c5e0857f99c64871205b2e1c14fe7e to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name dev_reddit_timeframe | |
// @namespace2 unt0uchable | |
// @description Display buttons for different timeframes on subreddit top page | |
// @author unt0uchable | |
// @include *reddit.com/top/* | |
// @include *reddit.com/r/*/top/* | |
// @include *reddit.com/me/m/*/top/* | |
// @version 1 | |
// @grant GM_config | |
// @grant GM_xmlhttpRequest | |
// @grant GM_getResourceURL | |
// @grant GM_getValue | |
// @grant GM_setValue | |
// @grant GM_registerMenuCommand | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js | |
// @require https://greasyfork.org/libraries/GM_config/20131122/GM_config.js | |
// ==/UserScript== | |
/* | |
Other includes: | |
// @include *reddit.com/user/*sort=top* | |
*/ | |
this.$ = this.jQuery = jQuery.noConflict(true); | |
try { | |
$('.menuarea .dropdown-title').contents().eq(0).replaceWith('Time: '); | |
$('.menuarea .dropdown').css({'margin-right':'30px'}); | |
// $('.menuarea .dropdown').attr('onmouseover','open_menu(this)'); | |
// $('.menuarea .drop-choices').attr('onmouseover','open_menu(this)'); | |
// $('.menuarea .drop-choices').attr('onmouseout','close_menu(this)'); | |
// $('.menuarea .dropdown').attr('hover','open_menu(this)'); | |
// $('.menuarea .dropdown').attr('hover','open_menu(this)','close_menus(this)'); | |
$('.menuarea .drop-choices .choice').text(function () { | |
return $(this).text().replace('this ', ''); | |
}); | |
$('.menuarea .drop-choices .choice').text(function () { | |
return $(this).text().replace(' time', ''); | |
}); | |
$('.menuarea .selected').text(function () { | |
return $(this).text().replace('this ', ''); | |
}); | |
$('.menuarea .selected').text(function () { | |
return $(this).text().replace(' time', ''); | |
}); | |
$('.drop-choices form').each(function () { | |
$('.menuarea .spacer').append($(this).clone().css({'display':'inline','margin-right':'15px'})); | |
}); | |
} catch (err) { | |
alert(err.toString()); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment