Changeset 645daf8 in sicp for static


Ignore:
Timestamp:
Aug 12, 2015, 5:16:09 PM (9 years ago)
Author:
Ing. Roldan D. Vargas G <rvargas@…>
Branches:
master
Children:
0b0f1eb
Parents:
ca89a71
Message:

agregada funcionalidad para imprimir el árbol de la cadena productiva.
se agrega plugin de JQuery para imprimir código HTML

File:
1 edited

Legend:

Unmodified
Added
Removed
  • static/js/funciones.js

    r24b7cf7 r645daf8  
    565565    });
    566566}
     567
     568/**
     569 * @brief Función que ejecuta la accion que permite imprimir la cadena productiva en formato pdf
     570 *
     571 * @author Ing. Roldan Vargas (rvargas at cenditel.gob.ve)
     572 * @copyright GNU/GPLv2
     573 * @date 12-08-2015
     574 */
     575function print_cadena_productiva(url, tree, nombre_cadena) {
     576    var tree_content = tree.treeview('expandAll', { silent: true }).html();
     577    var year = new Date().getFullYear();
     578    var header = "<div><img src='"+CINTILLO+"'></div>";
     579    header += "<div class='text-center'>"+TITLE_REPORT_CADENA+" - "+nombre_cadena+"</div><br/>";
     580    var footer = "<div class='text-center'>Centro Nacional de Desarrollo e Investigación en Tecnologías Libres (CENDITEL)</div>";
     581    footer += "<div class='text-center'>GPL v2.0 - Copyleft 2015 - "+year+".</div><br/>";
     582
     583    tree.attr('style', '');
     584    tree.print({
     585        // Use Global styles
     586        globalStyles : true,
     587        // Add link with attrbute media=print
     588        mediaPrint : true,
     589        //Custom stylesheet
     590        //stylesheet : "http://fonts.googleapis.com/css?family=Inconsolata",
     591        //Print in a hidden iframe
     592        iframe : true,
     593        // Don't print this
     594        //noPrintSelector : ".avoid-this",
     595        // Add this on bottom
     596        append : footer,
     597        // Add this at top
     598        prepend : header,
     599        // Manually add form values
     600        manuallyCopyFormValues: true,
     601        // resolves after print and restructure the code for better maintainability
     602        deferred: $.Deferred()
     603        // timeout
     604        //timeout: 250
     605    });
     606    tree.treeview('collapseAll', { silent: true }).html();
     607}
Note: See TracChangeset for help on using the changeset viewer.