[ Index ] |
|
Code source de IMP H3 (4.1.5) |
1 /** 2 * IMP Popup JavaScript. 3 * 4 * Provides the javascript to open popup windows. 5 * 6 * $Horde: imp/templates/javascript/popup.js,v 1.1.2.2 2006/02/10 21:10:26 slusarz Exp $ 7 * 8 * See the enclosed file COPYING for license information (LGPL). If you did not 9 * receive this file, see http://www.fsf.org/copyleft/lgpl.html. 10 */ 11 12 /** 13 * Open a popup window. 14 * 15 * @param string $url The URL to open in the popup window. 16 * @param optional integer $width The width of the popup window. (Default: 17 * 600 px) 18 * @param optional integer $height The height of the popup window. (Default: 19 * 500 px) 20 * @param optional string $args Any additional args to pass to the script. 21 * (Default: no args) 22 */ 23 function popup_imp(url, width, height, args) 24 { 25 if (!width) { 26 width = 600; 27 } 28 var screen_width = screen.width; 29 if (width > (screen_width - 75)) { 30 width = screen_width - 75; 31 } 32 33 if (!height) { 34 height = 500; 35 } 36 var screen_width = screen.width; 37 if (width > (screen_width - 75)) { 38 width = screen_width - 75; 39 } 40 41 var now = new Date(); 42 var name = now.getTime(); 43 44 if (url.indexOf('?') == -1) { 45 var glue = '?'; 46 } else { 47 var glue = '&'; 48 } 49 50 if (args != "") { 51 url = url + glue + args + "&uniq=" + name; 52 } else { 53 url = url + glue + "uniq=" + name; 54 } 55 56 param = "toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=" + width + ",height=" + height + ",left=0,top=0"; 57 win = window.open(url, name, param); 58 if (!win) { 59 alert("<?php echo addslashes(_("The image save window can not be opened. Perhaps you have set your browser to block popup windows?")) ?>"); 60 } else { 61 if (!eval("win.opener")) { 62 win.opener = self; 63 } 64 win.focus(); 65 } 66 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 12:30:07 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |