2011-09-09 16:08:40 -04:00
|
|
|
<!DOCTYPE html>
|
2008-01-30 01:55:47 -05:00
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
2008-01-31 13:10:46 -05:00
|
|
|
<title></title>
|
2011-09-09 16:08:40 -04:00
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
2012-02-04 17:23:27 -05:00
|
|
|
<script type="text/javascript" src="../../tiny_mce.js?ver=348-20120204"></script>
|
2008-01-30 01:55:47 -05:00
|
|
|
<script type="text/javascript">
|
|
|
|
function patchCallback(settings, key) {
|
|
|
|
if (settings[key])
|
|
|
|
settings[key] = "window.opener." + settings[key];
|
|
|
|
}
|
|
|
|
|
2008-06-19 12:55:50 -04:00
|
|
|
var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
|
2008-01-30 01:55:47 -05:00
|
|
|
|
|
|
|
// Clone array
|
|
|
|
for (var n in paSe)
|
|
|
|
settings[n] = paSe[n];
|
|
|
|
|
|
|
|
// Override options for fullscreen
|
|
|
|
for (var n in paSe.fullscreen_settings)
|
|
|
|
settings[n] = paSe.fullscreen_settings[n];
|
|
|
|
|
|
|
|
// Patch callbacks, make them point to window.opener
|
|
|
|
patchCallback(settings, 'urlconverter_callback');
|
|
|
|
patchCallback(settings, 'insertlink_callback');
|
|
|
|
patchCallback(settings, 'insertimage_callback');
|
|
|
|
patchCallback(settings, 'setupcontent_callback');
|
|
|
|
patchCallback(settings, 'save_callback');
|
|
|
|
patchCallback(settings, 'onchange_callback');
|
|
|
|
patchCallback(settings, 'init_instance_callback');
|
|
|
|
patchCallback(settings, 'file_browser_callback');
|
|
|
|
patchCallback(settings, 'cleanup_callback');
|
|
|
|
patchCallback(settings, 'execcommand_callback');
|
|
|
|
patchCallback(settings, 'oninit');
|
|
|
|
|
|
|
|
// Set options
|
|
|
|
delete settings.id;
|
|
|
|
settings['mode'] = 'exact';
|
|
|
|
settings['elements'] = 'fullscreenarea';
|
|
|
|
settings['add_unload_trigger'] = false;
|
|
|
|
settings['ask'] = false;
|
|
|
|
settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
|
|
|
|
settings['fullscreen_is_enabled'] = true;
|
2008-06-19 12:55:50 -04:00
|
|
|
settings['fullscreen_editor_id'] = oeID;
|
2008-01-30 01:55:47 -05:00
|
|
|
settings['theme_advanced_resizing'] = false;
|
2008-02-21 16:40:25 -05:00
|
|
|
settings['strict_loading_mode'] = true;
|
|
|
|
|
|
|
|
settings.save_onsavecallback = function() {
|
2008-06-19 12:55:50 -04:00
|
|
|
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
|
|
|
|
window.opener.tinyMCE.get(oeID).execCommand('mceSave');
|
2008-02-21 16:40:25 -05:00
|
|
|
window.close();
|
|
|
|
};
|
2008-01-30 01:55:47 -05:00
|
|
|
|
|
|
|
function unloadHandler(e) {
|
|
|
|
moveContent();
|
|
|
|
}
|
|
|
|
|
|
|
|
function moveContent() {
|
2008-06-19 12:55:50 -04:00
|
|
|
window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
|
2008-01-30 01:55:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function closeFullscreen() {
|
|
|
|
moveContent();
|
|
|
|
window.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
function doParentSubmit() {
|
|
|
|
moveContent();
|
|
|
|
|
|
|
|
if (window.opener.tinyMCE.selectedInstance.formElement.form)
|
|
|
|
window.opener.tinyMCE.selectedInstance.formElement.form.submit();
|
|
|
|
|
|
|
|
window.close();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2008-02-27 00:36:42 -05:00
|
|
|
|
|
|
|
function render() {
|
|
|
|
var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
|
|
|
|
|
2008-06-19 12:55:50 -04:00
|
|
|
e.value = window.opener.tinyMCE.get(oeID).getContent();
|
2008-02-27 00:36:42 -05:00
|
|
|
|
|
|
|
vp = dom.getViewPort();
|
|
|
|
settings.width = vp.w;
|
|
|
|
settings.height = vp.h - 15;
|
|
|
|
|
|
|
|
tinymce.dom.Event.add(window, 'resize', function() {
|
|
|
|
var vp = dom.getViewPort();
|
|
|
|
|
|
|
|
tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
|
|
|
|
});
|
|
|
|
|
|
|
|
tinyMCE.init(settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Add onunload
|
|
|
|
tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
|
2008-01-30 01:55:47 -05:00
|
|
|
</script>
|
|
|
|
</head>
|
2008-01-31 13:10:46 -05:00
|
|
|
<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
|
|
|
|
<form onsubmit="doParentSubmit();">
|
2008-01-30 01:55:47 -05:00
|
|
|
<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
|
|
|
|
</form>
|
2008-01-31 13:10:46 -05:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2008-02-27 00:36:42 -05:00
|
|
|
render();
|
2008-01-31 13:10:46 -05:00
|
|
|
</script>
|
|
|
|
|
2008-01-30 01:55:47 -05:00
|
|
|
</body>
|
|
|
|
</html>
|