-
-
Save betamatt/2973225 to your computer and use it in GitHub Desktop.
A userscript for Flowdock that adds a button next to inline elements like Tweets and Images that allows you to hide them. Really useful to hide annoying animated gifs and hubot pug bombs
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 Hide Images | |
// @namespace http://fluidapp.com | |
// @description Adds a button to hide images | |
// @include * | |
// @author Someone | |
// ==/UserScript== | |
// originally from: https://gist.github.com/1649063 | |
$(function () { | |
if (window.fluid) { | |
setInterval(function(){ | |
$('.image-preview-wrapper').not('.hideBtnAdded').each(function() { | |
var t = $(this); | |
if (t.find('.hideImg').length === 0) { | |
t.append('<button class="hideImg">Hide This Image</button>'); | |
t.addClass('hideBtnAdded'); | |
} | |
}); | |
}, 1000); | |
setInterval(function() { | |
$('#chat_app_lines').on('click', 'button.hideImg', function() { | |
var t = $(this).parent(); | |
t.hide(); | |
t.prev().show(); | |
return false; | |
}); | |
}, 1000); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment