62 function closeFullscreen() { |
62 function closeFullscreen() { |
63 moveContent(); |
63 moveContent(); |
64 window.close(); |
64 window.close(); |
65 } |
65 } |
66 |
66 |
67 // Add onunload |
|
68 tinymce.dom.Event.add(window, "beforeunload", unloadHandler); |
|
69 |
|
70 function doParentSubmit() { |
67 function doParentSubmit() { |
71 moveContent(); |
68 moveContent(); |
72 |
69 |
73 if (window.opener.tinyMCE.selectedInstance.formElement.form) |
70 if (window.opener.tinyMCE.selectedInstance.formElement.form) |
74 window.opener.tinyMCE.selectedInstance.formElement.form.submit(); |
71 window.opener.tinyMCE.selectedInstance.formElement.form.submit(); |
75 |
72 |
76 window.close(); |
73 window.close(); |
77 |
74 |
78 return false; |
75 return false; |
79 } |
76 } |
|
77 |
|
78 function render() { |
|
79 var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM; |
|
80 |
|
81 e.value = window.opener.tinyMCE.activeEditor.getContent(); |
|
82 |
|
83 vp = dom.getViewPort(); |
|
84 settings.width = vp.w; |
|
85 settings.height = vp.h - 15; |
|
86 |
|
87 tinymce.dom.Event.add(window, 'resize', function() { |
|
88 var vp = dom.getViewPort(); |
|
89 |
|
90 tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h); |
|
91 }); |
|
92 |
|
93 tinyMCE.init(settings); |
|
94 } |
|
95 |
|
96 // Add onunload |
|
97 tinymce.dom.Event.add(window, "beforeunload", unloadHandler); |
80 </script> |
98 </script> |
81 <base target="_self" /> |
99 <base target="_self" /> |
82 </head> |
100 </head> |
83 <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> |
101 <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no"> |
84 <form onsubmit="doParentSubmit();"> |
102 <form onsubmit="doParentSubmit();"> |
85 <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> |
103 <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea> |
86 </form> |
104 </form> |
87 |
105 |
88 <script type="text/javascript"> |
106 <script type="text/javascript"> |
89 var e = document.getElementById('fullscreenarea'); |
107 render(); |
90 e.value = window.opener.tinyMCE.activeEditor.getContent(); |
|
91 settings.width = window.innerWidth || document.body.clientWidth; |
|
92 settings.height = (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - 18; |
|
93 tinyMCE.init(settings); |
|
94 </script> |
108 </script> |
95 |
109 |
96 </body> |
110 </body> |
97 </html> |
111 </html> |