Skip to content

Instantly share code, notes, and snippets.

@betamatt
Forked from johnmaxwell/hide-inline-images.js
Created June 22, 2012 14:51
Show Gist options
  • Save betamatt/2973225 to your computer and use it in GitHub Desktop.
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
// ==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