Files
gallery3/modules/digibug/js/digibug.js
Tim Almdal 231ad4f329 This implements the Digibug printing. When a a print request is made the digibug shopping cart is opened in a new
window.  When the cart is emptied, the window is closed. Users can close the window by pressing the continue shopping
button
2009-06-23 22:13:28 -07:00

47 lines
1.1 KiB
JavaScript

$(document).ready(function() {
$(".gDigibugPrintButton a").click(function(e) {
e.preventDefault();
queue_print(e);
});
});
function popUp(url, options) {
options = $.extend({
/* default options */
width: 400,
height: 400,
target: 'dbPopWin',
scrollbars: 'yes',
resizable: 'no',
menuBar: 'no',
addressBar: 'yes'}, options);
/* center the window by default. */
if (!options.winY) {
options.winY = screen.height / 2 - options.height / 2;
};
if (!options.winX) {
options.winX = screen.width / 2 - options.width / 2;
};
open(
url,
options['target'],
'width= ' + options.width +
',height=' + options.height +
',top=' + options.winY +
',left=' + options.winX +
',scrollbars=' + options.scrollbars +
',resizable=' + options.resizable +
',menubar=' + options.menuBar +
',location=' + options.addressBar
);
return false;
}
function queue_print(e) {
return popUp(e.currentTarget.href, { width: 800, height: 600 } );
};