summaryrefslogtreecommitdiff
path: root/modules/digibug/js/digibug.js
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-06-24 23:02:57 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-06-24 23:02:57 +0200
commit6111272568a732465c330597a068a048f6705ef9 (patch)
treef8829dfb4c4ee566a69f91d397e74e74aec56dbd /modules/digibug/js/digibug.js
parentde28b0350e5d5bf6c3e1eb5a9531298b08fd7cba (diff)
parentf56d372629df5b08a30d0182d4e1e7c97a44d79f (diff)
Merge commit 'upstream/master'
Conflicts: modules/comment/helpers/comment_installer.php modules/gallery/models/item.php
Diffstat (limited to 'modules/digibug/js/digibug.js')
-rw-r--r--modules/digibug/js/digibug.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/modules/digibug/js/digibug.js b/modules/digibug/js/digibug.js
new file mode 100644
index 00000000..e9e8933e
--- /dev/null
+++ b/modules/digibug/js/digibug.js
@@ -0,0 +1,46 @@
+$(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 } );
+};