static/media/js/print.js @ de64f1b0d5c0

Add public to .hgignore.
author Steve Losh <steve@stevelosh.com>
date Fri, 07 Oct 2016 12:50:31 +0000
parents e7bc59b9ebda
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);
        });
    });
});