Forked from curtisj44/trello-mood-board-bookmarklet.js
Last active
October 29, 2015 11:00
-
-
Save evoactivity/368d2b125a0e2145f255 to your computer and use it in GitHub Desktop.
Trello Mood Board
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
if ($('.mood-board').length > 0) { | |
$('.mood-board').remove(); | |
} else { | |
var $thumbnails = $(".js-card-cover"), | |
board, | |
image; | |
board = '<style class="mood-board">' + | |
'.body-board-view {'+ | |
'overflow-y: scroll;' + | |
'}' + | |
'ul.mood-board {' + | |
'position: absolute;' + | |
'z-index: 50;' + | |
'top: 0;' + | |
'right: 0;' + | |
'bottom: 0;' + | |
'left: 0;' + | |
'overflow-y: scroll;' + | |
'padding: 0;' + | |
'background: #000;' + | |
'}' + | |
'ul.mood-board li {' + | |
'width: 33.333%' + | |
'}' + | |
'ul.mood-board img {' + | |
'padding: 0;' + | |
'background: #000;' + | |
'display: block;' + | |
'width: 100%;' + | |
'}' + | |
'</style>'; | |
$thumbnails.each(function () { | |
image = $(this).css('background-image').replace('url("', '').replace('")', ''); | |
if ( image !== 'none' ){ | |
board += '<li><a href="' + image + '"><img src="' + image + '" /></a></li>'; | |
} | |
}); | |
$('body').append('<ul class="mood-board">' + board + '</ol>'); | |
$.ajax({ | |
url: 'https://cdnjs.cloudflare.com/ajax/libs/masonry/3.1.2/masonry.pkgd.min.js', | |
dataType: 'script', | |
success: function () { | |
$('ul.mood-board').masonry({ | |
columnWidth: 0, | |
containerStyle: null, | |
itemSelector: 'li' | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found this gist here https://gist.github.com/curtisj44/10951996 but it no longer worked, forked and updated so it works.
bookmarklet