summaryrefslogtreecommitdiff
path: root/modules/digibug/js/digibug.js
blob: 78ca8cf332c99b9c27ad0b2afebcf5988c230bd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
function digibug_popup(url, options) {
  options = $.extend({
    /* default options */
    width:      '800',
    height:     '600',
    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;

}