Template:PrintContainer

    Table of contents
    No headers
    // AUTHOR: rberinger
    // VERSION: 1.0
    // DATE: 11/23/2009
    
    // ARGUMENTS:
    //    container: The container class or id of the portion of the page to print
    //    text:  The text for the print link or button
    //    button:  (Present as a button) - true or false 
    
    var container = ($container ?? $0 ?? '#pageText');
    var linktext = ($text ?? $1 ?? 'Print');
    var button = ($button ?? $2 ?? false);
    
    var id = @id;
    
    if(button == false) {
        <a id=(id) class="printit">(linktext)</a>
    } else {
        <input type="button" id=(id) class="printit" value=(linktext) />
    }
    
    <html><head>
    
        <script type="text/javascript" src="http://developer.mindtouch.com/@api/deki/files/4952/=jQuery.print.js" />
    
        <script type="text/javascript">"
    
            $(document).ready(function() {
    
                // Hook up the print link.
                $( "..json.emit('#'..id)..").attr( 'href', 'javascript:void( 0 )' ).click(function(){
            
                    //  Insert code here if you need to reformate the information within the 
                    //  Print container prior to printing.
    
    
                    // Print the DIV.
                    $("..json.emit(container)..").print();
     
                    // Cancel click event.
                    return( false );
                });
    
            });
            
        "</script>
    
    </head></html> 
    
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by