File: popup.js

package info (click to toggle)
horde3 3.1.3-4etch7
  • links: PTS
  • area: main
  • in suites: etch
  • size: 22,876 kB
  • ctags: 18,071
  • sloc: php: 75,151; xml: 2,979; sql: 1,069; makefile: 79; sh: 64
file content (35 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download | duplicates (2)
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
/**
 * Horde Popup JavaScript.
 *
 * Provides the javascript to open popup windows.
 *
 * $Horde: horde/js/popup.js,v 1.2.10.4 2006/02/10 18:14:54 chuck Exp $
 *
 * See the enclosed file COPYING for license information (LGPL). If you did not
 * receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */
function popup(url, width, height)
{
    if (!width) {
        width = 600;
    }
    if (!height) {
        height = 500;
    }

    var name = (new Date()).getTime();
    var param = "toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0";
    var win = window.open(url, name, param);
    if (!win) {
        alert("A popup window could not be opened. Your browser may be blocking popups for this application.");
    } else {
        if (typeof win.name == 'undefined') {
            win.name = name;
        }
        if (typeof win.opener == 'undefined') {
            win.opener = self;
        }
    }

    return win;
}