-
-
Save johnmaxwell/1846289 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
// 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); | |
var clickInit = function() { | |
var chats = $('#chat_app_lines'); | |
if (chats.children().length > 0) { | |
chats.on('click', 'button.hideImg', function(){ | |
var t = $(this).parent(); | |
t.hide(); | |
t.prev().show(); | |
clearInterval(clickInit); | |
return false; | |
}); | |
} | |
} | |
var clickInterval = setInterval(clickInit, 1000); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment