[ Index ] |
|
Code source de Horde 3.1.3 |
1 <script type="text/javascript"> 2 <!-- 3 4 var da = (document.all) ? 1 : 0; 5 var pr = (window.print) ? 1 : 0; 6 var mac = (navigator.userAgent.indexOf("Mac") != -1); 7 8 if (window.addEventListener) { 9 window.addEventListener('load', printWin, false); 10 } else if (window.attachEvent) { 11 window.attachEvent('onload', printWin); 12 } else if (window.onload != null) { 13 var oldOnLoad = window.onload; 14 window.onload = function(e) 15 { 16 oldOnLoad(e); 17 printWin(); 18 }; 19 } else { 20 window.onload = printWin; 21 } 22 23 function printWin() 24 { 25 if (pr) { 26 // NS4+, IE5+ 27 window.print(); 28 } else if (!mac) { 29 // IE3 and IE4 on PC 30 VBprintWin(); 31 } else { 32 // everything else 33 handle_error(); 34 } 35 } 36 37 window.onerror = handle_error; 38 window.onafterprint = function() {window.close()} 39 40 function handle_error() 41 { 42 window.alert('<?php echo addslashes(_("Your browser does not support this print option. Press Control/Command + P to print.")) ?>'); 43 return true; 44 } 45 46 if (!pr && !mac) { 47 if (da) { 48 // This must be IE4 or greater 49 wbvers = "8856F961-340A-11D0-A96B-00C04FD705A2"; 50 } else { 51 // this must be IE3.x 52 wbvers = "EAB22AC3-30C1-11CF-A7EB-0000C05BAE0B"; 53 } 54 55 document.write("<OBJECT ID=\"WB\" WIDTH=\"0\" HEIGHT=\"0\" CLASSID=\"CLSID:"); 56 document.write(wbvers + "\"> </OBJECT>"); 57 } 58 59 // --> 60 </script> 61 62 <script type="text/vbscript"> 63 <!-- 64 65 sub window_onunload 66 on error resume next 67 ' Just tidy up when we leave to be sure we aren't 68 ' keeping instances of the browser control in memory 69 set WB = nothing 70 end sub 71 72 sub VBprintWin 73 OLECMDID_PRINT = 6 74 on error resume next 75 76 ' IE4 object has a different command structure 77 if da then 78 call WB.ExecWB(OLECMDID_PRINT, 1) 79 else 80 call WB.IOleCommandTarget.Exec(OLECMDID_PRINT, 1, "", "") 81 end if 82 end sub 83 84 ' --> 85 </script>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 18:01:28 2007 | par Balluche grâce à PHPXref 0.7 |