Remove in-template javascript, add script files
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 24 Aug 2011 15:31:59 +0000 (11:31 -0400)
committerJason Etheridge <jason@esilibrary.com>
Tue, 4 Oct 2011 17:24:25 +0000 (13:24 -0400)
commit3a3faae60f68b103003379660869ed5379d81215
treef07a5b596957146ef7c86b6a8b2a9637fb93362c
parent6d4c3632a3993c14483f729d8b85d64388c7518f
Remove in-template javascript, add script files

Adds support for a print_custom.js file and an org unit specified file.

If either exists and contains a print_custom function it will be called
before printing to allow for DOM manipulation.

If neither exists the print_win.js file will call all functions it has
defined.

In addition, if any code sets do_print to false the window will close
instead of attempting to print.

The print_custom function will receive the type of template used, if any.
This only applies to "Receipt Template" based print jobs, and the type in
question is the "Type" that shows in the template editor.

Functions defined in print_win.js:

print_init
    Main function, checks for print_custom and does final printing

print_do_sums
    Does summing of values.

print_check_alt
    Does swapping out of template blocks with display:none styling.

print_check_noprint
    Disables printing under certain circumstances.

For more information about usage of the print_do_sums, print_check_alt,
and print_check_noprint functions check the comments in print_win.js.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Open-ILS/xul/staff_client/chrome/content/util/print.js
Open-ILS/xul/staff_client/chrome/content/util/print_win.js [new file with mode: 0644]