Snippets

Luděk Uiberlay BitBucket - view old repository icons

Created by Luděk Uiberlay last modified
$.each($('.repo-list--repo'), function() {
    var $this = $(this);
    var $img = $this.find('.aui-avatar-inner img');
    var location = $this.find('.repo-list--repo-name').attr('href');

    if (!$img.length) {
        $this.find('.aui-icon').remove();
        var $span = $('<span class="project-avatar aui-avatar aui-avatar-project aui-avatar-small repo-list--avatar"> <span class="aui-avatar-inner"> <img src="' + location +'/avatar"></span></span>');

        $this.prepend($span);
    }  
    else {
        $img.attr('src', location + '/avatar');
    }  
})

var $avatarLink = $('.aui-page-header-inner #repo-avatar-link');
var $avatarImg = $avatarLink.find('img');
$avatarImg.attr('src', $avatarLink.attr('href') + '/avatar');

Comments (5)

  1. Nick Palmius

    I can't actually get Custom JavaScript for websites to run for some reason (not a problem with this code) but great work for putting this together :) Shame that you have to though - I hope they fix this!

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.