[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 // Get tinyMCE window 2 var win = window.opener ? window.opener : window.dialogArguments; 3 4 var tinyMCE = null; 5 var tinyMCELang = null; 6 7 // Use top window if not defined 8 if (!win) 9 win = top; 10 11 var tinyMCE = win.tinyMCE; 12 var tinyMCELang = win.tinyMCELang; 13 14 if (!tinyMCE) 15 alert("tinyMCE object reference not found from popup."); 16 17 // Setup window openerer 18 window.opener = win; 19 20 // Setup title 21 var re = new RegExp('{|\\\$|}', 'g'); 22 var title = document.title.replace(re, ""); 23 if (typeof tinyMCELang[title] != "undefined") { 24 var divElm = document.createElement("div"); 25 divElm.innerHTML = tinyMCELang[title]; 26 document.title = divElm.innerHTML; 27 } 28 29 // Setup dir 30 if (tinyMCELang['lang_dir']) 31 document.dir = tinyMCELang['lang_dir']; 32 33 function TinyMCEPlugin_onLoad() { 34 if (tinyMCE.getWindowArg('mce_replacevariables', true)) 35 document.body.innerHTML = tinyMCE.applyTemplate(document.body.innerHTML, tinyMCE.windowArgs); 36 37 // Auto resize window 38 if (tinyMCE.getWindowArg('mce_windowresize', true)) { 39 var width = tinyMCE.isMSIE ? document.body.offsetWidth : window.innerWidth; 40 var height = tinyMCE.isMSIE ? document.body.offsetHeight : window.innerHeight; 41 var dx = document.body.scrollWidth - width; 42 var dy = document.body.scrollHeight - height; 43 44 if (tinyMCE.isMSIE) { 45 window.dialogWidth = (parseInt(window.dialogWidth) + dx) + "px"; 46 window.dialogHeight = (parseInt(window.dialogHeight) + dy + 3) + "px"; 47 } else 48 window.resizeBy(dx + 15, dy + 15); 49 } 50 } 51 52 function TinyMCEPopup_autoResize() { 53 var isMSIE = (navigator.appName == "Microsoft Internet Explorer"); 54 var isOpera = (navigator.userAgent.indexOf("Opera") != -1); 55 56 if (isOpera) 57 return; 58 59 if (isMSIE) { 60 try { window.resizeTo(10, 10); } catch (e) {} 61 62 var elm = document.body; 63 var width = elm.offsetWidth; 64 var height = elm.offsetHeight; 65 var dx = (elm.scrollWidth - width) + 4; 66 var dy = elm.scrollHeight - height; 67 68 try { window.resizeBy(dx, dy); } catch (e) {} 69 } else { 70 window.scrollBy(1000, 1000); 71 if (window.scrollX > 0 || window.scrollY > 0) { 72 window.resizeBy(window.innerWidth * 2, window.innerHeight * 2); 73 window.sizeToContent(); 74 window.scrollTo(0, 0); 75 var x = parseInt(screen.width / 2.0) - (window.outerWidth / 2.0); 76 var y = parseInt(screen.height / 2.0) - (window.outerHeight / 2.0); 77 window.moveTo(x, y); 78 } 79 } 80 } 81 82 // Add onload trigger 83 tinyMCE.addEvent(window, "load", TinyMCEPlugin_onLoad); 84 85 // Output Popup CSS class 86 document.write('<link href="' + tinyMCE.getParam("popups_css") + '" rel="stylesheet" type="text/css">');
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |