media/js/print.js @ 369014a3a038

Fix some mistakes in the Vim entry.
author Steve Losh <steve@stevelosh.com>
date Mon, 20 Sep 2010 20:42:03 -0400
parents 8534b74192a8
children (none)
$(function() {
    $('#leaf-content p:has(a)').add('#leaf-content ol:has(a)').add('#leaf-content ul:has(a)').each(function() {
        var printing_links = $(this).find('a')
                                    .not("[href^='#']")
                                    .not(":has(img)")
                                    .clone();
        $(this).after(printing_links);

        printing_links.wrap('<li></li>')
                      .parent()
                      .wrapAll('<ul class="print-links"></ul>');

        printing_links.each(function() {
            var href = $(this).attr('href');
            if (href.match("^/")) {
                href = 'http://stevelosh.com' + href;
            }
            $(this).after(': ' + href);
        });
    });
});