mp-wp_genesis 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
mp-wp_genesis 2 <html xmlns="http://www.w3.org/1999/xhtml">
mp-wp_genesis 3 <head>
mp-wp_genesis 4 <title></title>
mp-wp_genesis 5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
mp-wp_genesis 6 <script type="text/javascript" src="../../tiny_mce.js?ver=3211"></script>
mp-wp_genesis 7 <script type="text/javascript">
mp-wp_genesis 8 function patchCallback(settings, key) {
mp-wp_genesis 9 if (settings[key])
mp-wp_genesis 10 settings[key] = "window.opener." + settings[key];
mp-wp_genesis 11 }
mp-wp_genesis 12
mp-wp_genesis 13 var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
mp-wp_genesis 14
mp-wp_genesis 15 // Clone array
mp-wp_genesis 16 for (var n in paSe)
mp-wp_genesis 17 settings[n] = paSe[n];
mp-wp_genesis 18
mp-wp_genesis 19 // Override options for fullscreen
mp-wp_genesis 20 for (var n in paSe.fullscreen_settings)
mp-wp_genesis 21 settings[n] = paSe.fullscreen_settings[n];
mp-wp_genesis 22
mp-wp_genesis 23 // Patch callbacks, make them point to window.opener
mp-wp_genesis 24 patchCallback(settings, 'urlconverter_callback');
mp-wp_genesis 25 patchCallback(settings, 'insertlink_callback');
mp-wp_genesis 26 patchCallback(settings, 'insertimage_callback');
mp-wp_genesis 27 patchCallback(settings, 'setupcontent_callback');
mp-wp_genesis 28 patchCallback(settings, 'save_callback');
mp-wp_genesis 29 patchCallback(settings, 'onchange_callback');
mp-wp_genesis 30 patchCallback(settings, 'init_instance_callback');
mp-wp_genesis 31 patchCallback(settings, 'file_browser_callback');
mp-wp_genesis 32 patchCallback(settings, 'cleanup_callback');
mp-wp_genesis 33 patchCallback(settings, 'execcommand_callback');
mp-wp_genesis 34 patchCallback(settings, 'oninit');
mp-wp_genesis 35
mp-wp_genesis 36 // Set options
mp-wp_genesis 37 delete settings.id;
mp-wp_genesis 38 settings['mode'] = 'exact';
mp-wp_genesis 39 settings['elements'] = 'fullscreenarea';
mp-wp_genesis 40 settings['add_unload_trigger'] = false;
mp-wp_genesis 41 settings['ask'] = false;
mp-wp_genesis 42 settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
mp-wp_genesis 43 settings['fullscreen_is_enabled'] = true;
mp-wp_genesis 44 settings['fullscreen_editor_id'] = oeID;
mp-wp_genesis 45 settings['theme_advanced_resizing'] = false;
mp-wp_genesis 46 settings['strict_loading_mode'] = true;
mp-wp_genesis 47
mp-wp_genesis 48 settings.save_onsavecallback = function() {
mp-wp_genesis 49 window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
mp-wp_genesis 50 window.opener.tinyMCE.get(oeID).execCommand('mceSave');
mp-wp_genesis 51 window.close();
mp-wp_genesis 52 };
mp-wp_genesis 53
mp-wp_genesis 54 function unloadHandler(e) {
mp-wp_genesis 55 moveContent();
mp-wp_genesis 56 }
mp-wp_genesis 57
mp-wp_genesis 58 function moveContent() {
mp-wp_genesis 59 window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
mp-wp_genesis 60 }
mp-wp_genesis 61
mp-wp_genesis 62 function closeFullscreen() {
mp-wp_genesis 63 moveContent();
mp-wp_genesis 64 window.close();
mp-wp_genesis 65 }
mp-wp_genesis 66
mp-wp_genesis 67 function doParentSubmit() {
mp-wp_genesis 68 moveContent();
mp-wp_genesis 69
mp-wp_genesis 70 if (window.opener.tinyMCE.selectedInstance.formElement.form)
mp-wp_genesis 71 window.opener.tinyMCE.selectedInstance.formElement.form.submit();
mp-wp_genesis 72
mp-wp_genesis 73 window.close();
mp-wp_genesis 74
mp-wp_genesis 75 return false;
mp-wp_genesis 76 }
mp-wp_genesis 77
mp-wp_genesis 78 function render() {
mp-wp_genesis 79 var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
mp-wp_genesis 80
mp-wp_genesis 81 e.value = window.opener.tinyMCE.get(oeID).getContent();
mp-wp_genesis 82
mp-wp_genesis 83 vp = dom.getViewPort();
mp-wp_genesis 84 settings.width = vp.w;
mp-wp_genesis 85 settings.height = vp.h - 15;
mp-wp_genesis 86
mp-wp_genesis 87 tinymce.dom.Event.add(window, 'resize', function() {
mp-wp_genesis 88 var vp = dom.getViewPort();
mp-wp_genesis 89
mp-wp_genesis 90 tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
mp-wp_genesis 91 });
mp-wp_genesis 92
mp-wp_genesis 93 tinyMCE.init(settings);
mp-wp_genesis 94 }
mp-wp_genesis 95
mp-wp_genesis 96 // Add onunload
mp-wp_genesis 97 tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
mp-wp_genesis 98 </script>
mp-wp_genesis 99 <base target="_self" />
mp-wp_genesis 100 </head>
mp-wp_genesis 101 <body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
mp-wp_genesis 102 <form onsubmit="doParentSubmit();">
mp-wp_genesis 103 <textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
mp-wp_genesis 104 </form>
mp-wp_genesis 105
mp-wp_genesis 106 <script type="text/javascript">
mp-wp_genesis 107 render();
mp-wp_genesis 108 </script>
mp-wp_genesis 109
mp-wp_genesis 110 </body>
mp-wp_genesis 111 </html>