Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Test sprite
- // @description hide questions by score, user reputation and accepted answers
- // @namespace http://stackapps.com/users/10590
- // @author brasofilo
- // @version 0.3
- // @copyright 2014, Rodolfo Buaiz (http://stackapps.com/users/10590/brasofilo)
- // @license ISC; http://opensource.org/licenses/ISC
- // @match http*://*.askubuntu.com/questions*
- // @match http*://*.askubuntu.com/unanswered*
- // @match http*://*.mathoverflow.net/questions*
- // @match http*://*.mathoverflow.net/unanswered*
- // @match http*://*.serverfault.com/questions*
- // @match http*://*.serverfault.com/unanswered*
- // @match http*://*.stackapps.com/questions*
- // @match http*://*.stackapps.com/unanswered*
- // @match http*://*.stackexchange.com/questions*
- // @match http*://*.stackexchange.com/unanswered*
- // @match http*://*.stackoverflow.com/questions*
- // @match http*://*.stackoverflow.com/unanswered*
- // @match http*://*.superuser.com/questions*
- // @match http*://*.superuser.com/unanswered*
- // @homepageURL http://stackapps.com/questions/
- // @grant GM_addStyle
- // ==/UserScript==
- GM_addStyle("\
- .se-app-gear1 { \
- background: url('http://i.stack.imgur.com/I5vIL.png') no-repeat -2px -2px !important; \
- width: 24px !important; \
- height: 14px !important; \
- margin-top: 9px; \
- } \
- .se-app-gear2 { \
- background: url('http://i.stack.imgur.com/I5vIL.png') no-repeat -2px -20px !important;\
- width: 24px !important; \
- height: 14px !important; \
- margin-top: 9px; \
- }");
- var userscript = function($) {
- var testForMod = function() {
- return $('div.topbar-links').find('.mod-only').length;
- }
- $class = testForMod() ? ' se-app-gear1' : ' icon-inbox-mod';
- var $html = '<a href="javascript:void(0)" id="my-se-mod" class="topbar-icon yes-hover' + $class + '" title="Testing mod icon"></a>';
- $($html).appendTo('div.network-items');
- var $icon = $('#my-se-mod');
- $icon.hover(
- function () {
- if( testForMod() )
- $(this).removeClass('se-app-gear1').addClass('se-app-gear2');
- else
- $(this).addClass('icon-inbox-mod-announcements');
- },
- function () {
- if( testForMod() )
- $(this).removeClass('se-app-gear2').addClass('se-app-gear1');
- else
- $(this).removeClass('icon-inbox-mod-announcements');
- }
- );
- };
- var el = document.createElement('script');
- el.type = 'text/javascript';
- el.text = '(' + userscript + ')(jQuery);';
- document.head.appendChild(el);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement