PageSourceSearch

https://www.legebatterijen.nl/assets/themes/stibat/js/print-een-briefje.js?ver=1787651125

js legebatterijen.nl collected 2026-10-02 06:24:32 UTC 2,003 bytes, 69 lines download raw bytes

1(function($) {
2    'use strict';
3
4    function initPrintEenBriefje() {
5
6        var $body = $(document.body);
7        $body.off("click", '.reprint', printBriefje);
8
9        if($('#show-on-print').length) {
10            window.onload = makePrintContentAndPrint();
11            $body.on("click", '.reprint', printBriefje);
12        }
13    }
14
15    function makePrintContentAndPrint() {
16
17        // The container for print content in this (iframed) page
18        var local_print_container = $('#print-container');
19
20        // Copy the note-text several times, to make maxium use of the paper
21        for (var i = 0; i < 8; i++) {
22            local_print_container.append('<div class="print-item">' + $('#handwriting').html() + '</div>');
23        }
24
25        // IE Has problems with printing an iframe, so we copy the print-content to the parent
26        // and print from there.
27        // The parent of the iframe:
28        var parent_print_container = $('#show-on-print', parent.document.body);
29        parent_print_container.html(local_print_container.html());
30
31        printBriefje();
32    }
33
34    function printBriefje() {
35        if ("MozAppearance" in document.documentElement.style) {
36            window.print();
37        } else {
38            parent.focus();
39            parent.print();
40        }
41    }
42
43
44    // After form submit, do the funtion Print briefje
45    // Create a new object for custom validation of a custom field.
46    var mySubmitController = Marionette.Object.extend( {
47
48        initialize: function() {
49            this.listenTo( Backbone.Radio.channel( 'form-16' ), 'submit:response', this.actionSubmit );
50        },
51
52        actionSubmit: function( response ) {
53            // Print briefje after submit handler
54            $("body").on("click", '.reprint', printBriefje);
55            makePrintContentAndPrint();
56
57        },
58
59    });
60
61
62    // Instantiate our custom field's controller, defined above.
63    new mySubmitController();
64
65
66
67   /// module.exports = initPrintEenBriefje;
68
69} (jQuery));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.