site-media/scripts/print-links.js @ 94edcb30827f

Move the link URLs to lists when printing.
author Steve Losh <steve@stevelosh.com>
date Mon, 15 Jun 2009 20:34:01 -0400
parents (none)
children (none)
$(document).ready(function() {
    $('p:has(a)').add('ol:has(a)').add('ul:has(a)').each(function() {
        var printing_links = $(this).find('a').clone();
        $(this).after(printing_links);
        
        printing_links.wrap('<li></li>')
                      .parent()
                      .wrapAll('<ul class="print-links"></ul>');
        
        printing_links.each(function() {
            $(this).after(': ' + $(this).attr('href'));
        });
    });
});